From: cuiweixie Date: Thu, 29 Sep 2022 12:35:12 +0000 (+0800) Subject: cmd/go/internal/bug: use bytes.Contains X-Git-Tag: go1.20rc1~806 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5613de9d47b518496b487804806db933b5ea375a;p=gostls13.git cmd/go/internal/bug: use bytes.Contains Change-Id: I982835eb0d051e48964fc4a66018514c7203dd0a Reviewed-on: https://go-review.googlesource.com/c/go/+/436696 Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/go/internal/bug/bug.go b/src/cmd/go/internal/bug/bug.go index 772b6d5dc7..e667012fbb 100644 --- a/src/cmd/go/internal/bug/bug.go +++ b/src/cmd/go/internal/bug/bug.go @@ -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:])) } }