src/cmd/go/internal/load/test.go | 2 +- diff --git a/src/cmd/go/internal/load/test.go b/src/cmd/go/internal/load/test.go index e5c074fa1930373779003804ccc63c20c383627f..f9bdd5e1fc2d1ad4f0532a23bd3f51e29fc6f14d 100644 --- a/src/cmd/go/internal/load/test.go +++ b/src/cmd/go/internal/load/test.go @@ -294,7 +294,7 @@ } pb := p.Internal.Build pmain.DefaultGODEBUG = defaultGODEBUG(loaderstate, pmain, pb.Directives, pb.TestDirectives, pb.XTestDirectives) - if pmain.Internal.BuildInfo == nil || pmain.DefaultGODEBUG != p.DefaultGODEBUG { + if !opts.SuppressBuildInfo && (pmain.Internal.BuildInfo == nil || pmain.DefaultGODEBUG != p.DefaultGODEBUG) { // Either we didn't generate build info for the package under test (because it wasn't package main), or // the DefaultGODEBUG used to build the test main package is different from the DefaultGODEBUG // used to build the package under test. If we didn't set build info for the package under test