1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:14:49 -07:00

cmd/asm: use strings.TrimSuffix

Change-Id: If08ce3f8534f5fb7ce97ec124bfeff937e65f63b
Reviewed-on: https://go-review.googlesource.com/c/go/+/435943
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
cuiweixie 2022-09-28 21:28:18 +08:00 committed by Gopher Robot
parent 090ec611df
commit 09daf313b2

View File

@ -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)
}
}