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

cmd/toolstash: use strings.LastIndexAny

Change-Id: I06a4610a5f5c49806a1b151a65c25bbbd881a314
Reviewed-on: https://go-review.googlesource.com/38753
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Yasuhiro Matsumoto 2017-03-28 17:28:24 +09:00 committed by Josh Bleecher Snyder
parent 474a26d4c8
commit d63e2b22b0

View File

@ -219,10 +219,7 @@ func main() {
}
tool = cmd[0]
if i := strings.LastIndex(tool, "/"); i >= 0 {
tool = tool[i+1:]
}
if i := strings.LastIndex(tool, `\`); i >= 0 {
if i := strings.LastIndexAny(tool, `/\`); i >= 0 {
tool = tool[i+1:]
}