From 2fedd335f00bfc084f9008fa3b2ffbfcad240f04 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Thu, 29 Sep 2022 20:40:44 +0800 Subject: [PATCH] cmd/go/internal/modindex: should omit comparison to bool constant Change-Id: Iea75d0475e1cc8f794a7bae864c6ce0e6e33cb6c Reviewed-on: https://go-review.googlesource.com/c/go/+/436698 Reviewed-by: Dmitri Shuralyov Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/cmd/go/internal/modindex/read.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/internal/modindex/read.go b/src/cmd/go/internal/modindex/read.go index da525ae446..d6a04a0156 100644 --- a/src/cmd/go/internal/modindex/read.go +++ b/src/cmd/go/internal/modindex/read.go @@ -769,7 +769,7 @@ func shouldBuild(sf *sourceFile, tags map[string]bool) bool { plusBuildConstraints := sf.plusBuildConstraints() for _, text := range plusBuildConstraints { if x, err := constraint.Parse(text); err == nil { - if imports.Eval(x, tags, true) == false { + if !imports.Eval(x, tags, true) { return false } }