mirror of
https://github.com/golang/go
synced 2024-11-18 06:24:47 -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:
parent
090ec611df
commit
09daf313b2
@ -84,9 +84,7 @@ func Parse() {
|
|||||||
flag.Usage()
|
flag.Usage()
|
||||||
}
|
}
|
||||||
input := filepath.Base(flag.Arg(0))
|
input := filepath.Base(flag.Arg(0))
|
||||||
if strings.HasSuffix(input, ".s") {
|
input = strings.TrimSuffix(input, ".s")
|
||||||
input = input[:len(input)-2]
|
|
||||||
}
|
|
||||||
*OutputFile = fmt.Sprintf("%s.o", input)
|
*OutputFile = fmt.Sprintf("%s.o", input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user