1
0
mirror of https://github.com/golang/go synced 2024-11-16 23:04:44 -07:00

cmd/go/internal/imports: include ToolTags in the Tags map

This fixes a regression introduced when the "race" mode tag was moved to
the ToolTags field in CL 358539.

Fixes #54468

Change-Id: I107771948a4fe9d743cc13d1c15f324212b08e03
GitHub-Last-Rev: d211e351ef
GitHub-Pull-Request: golang/go#54618
Reviewed-on: https://go-review.googlesource.com/c/go/+/425154
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Zeke Lu 2022-08-25 04:17:00 +00:00 committed by Gopher Robot
parent f50e47308d
commit 6ba2674ddc
2 changed files with 32 additions and 0 deletions

View File

@ -36,6 +36,9 @@ func loadTags() map[string]bool {
for _, tag := range cfg.BuildContext.BuildTags {
tags[tag] = true
}
for _, tag := range cfg.BuildContext.ToolTags {
tags[tag] = true
}
for _, tag := range cfg.BuildContext.ReleaseTags {
tags[tag] = true
}

View File

@ -0,0 +1,29 @@
# Tests Issue #54468
[short] skip 'links a test binary'
[!race] skip
go mod tidy
go test -c -o=$devnull -race .
! stderr 'cannot find package'
-- go.mod --
module testrace
go 1.18
require rsc.io/sampler v1.0.0
-- race_test.go --
//go:build race
package testrace
import (
"testing"
_ "rsc.io/sampler"
)
func TestRaceTag(t *testing.T) {
}