]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/build/constraint: delete, replace stringsCut calls with strings.Cut
authorJes Cok <xigua67damn@gmail.com>
Sat, 23 Sep 2023 04:15:40 +0000 (04:15 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 27 Sep 2023 14:19:00 +0000 (14:19 +0000)
Currently, the Go bootstrap toolchain is bumped to 1.20.

Change-Id: I6467768c0640a8e9aadbfea79cfdfb14b4b80679
GitHub-Last-Rev: 7cf2d54a4865b4c6c15af374a6c0fbdbcce8c3b6
GitHub-Pull-Request: golang/go#63174
Reviewed-on: https://go-review.googlesource.com/c/go/+/530676
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/go/build/constraint/vers.go

index 34c44dcf177b6718a1a35a172898c42e0f6bb638..c8421885a602b1fe1c61863ee13bc9fa65d5ec6e 100644 (file)
@@ -66,7 +66,7 @@ func minVersion(z Expr, sign int) int {
                if z.Tag == "go1" {
                        return 0
                }
-               _, v, _ := stringsCut(z.Tag, "go1.")
+               _, v, _ := strings.Cut(z.Tag, "go1.")
                n, err := strconv.Atoi(v)
                if err != nil {
                        // not a go1.N tag
@@ -76,14 +76,6 @@ func minVersion(z Expr, sign int) int {
        }
 }
 
-// TODO: Delete, replace calls with strings.Cut once Go bootstrap toolchain is bumped.
-func stringsCut(s, sep string) (before, after string, found bool) {
-       if i := strings.Index(s, sep); i >= 0 {
-               return s[:i], s[i+len(sep):], true
-       }
-       return s, "", false
-}
-
 // andVersion returns the minimum Go version
 // implied by the AND of two minimum Go versions,
 // which is the max of the versions.