diff --git a/src/cmd/asm/internal/flags/flags.go b/src/cmd/asm/internal/flags/flags.go index d5e818223b..b9a94a0c09 100644 --- a/src/cmd/asm/internal/flags/flags.go +++ b/src/cmd/asm/internal/flags/flags.go @@ -84,9 +84,7 @@ func Parse() { flag.Usage() } input := filepath.Base(flag.Arg(0)) - if strings.HasSuffix(input, ".s") { - input = input[:len(input)-2] - } + input = strings.TrimSuffix(input, ".s") *OutputFile = fmt.Sprintf("%s.o", input) } }