mirror of
https://github.com/golang/go.git
synced 2026-06-28 03:40:37 +00:00
go/build: check result of strings.Cut
Change-Id: Id393d916db51cced261c0ec1e24957dc310a4c9b
GitHub-Last-Rev: 5b7c262b73
GitHub-Pull-Request: golang/go#78756
Reviewed-on: https://go-review.googlesource.com/c/go/+/767200
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
3b345adf2c
commit
620cefa291
1 changed files with 4 additions and 1 deletions
|
|
@ -66,7 +66,10 @@ func minVersion(z Expr, sign int) int {
|
|||
if z.Tag == "go1" {
|
||||
return 0
|
||||
}
|
||||
_, v, _ := strings.Cut(z.Tag, "go1.")
|
||||
_, v, ok := strings.Cut(z.Tag, "go1.")
|
||||
if !ok {
|
||||
return -1
|
||||
}
|
||||
n, err := strconv.Atoi(v)
|
||||
if err != nil {
|
||||
// not a go1.N tag
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue