Skip to content

Commit 09daf31

Browse files
cuiweixiegopherbot
authored andcommitted
cmd/asm: use strings.TrimSuffix
Change-Id: If08ce3f8534f5fb7ce97ec124bfeff937e65f63b Reviewed-on: https://go-review.googlesource.com/c/go/+/435943 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Cherry Mui <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 090ec61 commit 09daf31

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/cmd/asm/internal/flags/flags.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ func Parse() {
8484
flag.Usage()
8585
}
8686
input := filepath.Base(flag.Arg(0))
87-
if strings.HasSuffix(input, ".s") {
88-
input = input[:len(input)-2]
89-
}
87+
input = strings.TrimSuffix(input, ".s")
9088
*OutputFile = fmt.Sprintf("%s.o", input)
9189
}
9290
}

0 commit comments

Comments
 (0)