mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
internal/goroot: replace HasPrefix+TrimPrefix with CutPrefix
Change-Id: I97305df6babbede57bb0c3b48c89c96cb74307f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/668456 Auto-Submit: Sean Liao <sean@liao.dev> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Sean Liao <sean@liao.dev> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
parent
8378276d66
commit
107fcb70de
1 changed files with 2 additions and 2 deletions
|
|
@ -77,8 +77,8 @@ func (gd *gccgoDirs) init() {
|
||||||
const prefix = "libraries: ="
|
const prefix = "libraries: ="
|
||||||
var dirs []string
|
var dirs []string
|
||||||
for _, dirEntry := range dirsEntries {
|
for _, dirEntry := range dirsEntries {
|
||||||
if strings.HasPrefix(dirEntry, prefix) {
|
if after, ok := strings.CutPrefix(dirEntry, prefix); ok {
|
||||||
dirs = filepath.SplitList(strings.TrimPrefix(dirEntry, prefix))
|
dirs = filepath.SplitList(after)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue