]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/bug: use bytes.Contains
authorcuiweixie <cuiweixie@gmail.com>
Thu, 29 Sep 2022 12:35:12 +0000 (20:35 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 29 Sep 2022 23:48:45 +0000 (23:48 +0000)
Change-Id: I982835eb0d051e48964fc4a66018514c7203dd0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/436696
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/cmd/go/internal/bug/bug.go

index 772b6d5dc74dce18ba80096b2fcd3375947cce44..e667012fbbb68d87e393bb9e22d31030f6b93811 100644 (file)
@@ -217,7 +217,7 @@ func printGlibcVersion(w io.Writer) {
        fmt.Fprintf(w, "%s: %s\n", m[1], firstLine(out))
 
        // print another line (the one containing version string) in case of musl libc
-       if idx := bytes.IndexByte(out, '\n'); bytes.Index(out, []byte("musl")) != -1 && idx > -1 {
+       if idx := bytes.IndexByte(out, '\n'); bytes.Contains(out, []byte("musl")) && idx > -1 {
                fmt.Fprintf(w, "%s\n", firstLine(out[idx+1:]))
        }
 }