1
0
mirror of https://github.com/golang/go synced 2024-11-24 09:00:13 -07:00

cmd/go/internal/work: omit modinfo line from cache key when empty

Cache keys are dumped in case of mismatch; an empty modinfo string
adds noise to that dump without a corresponding benefit.

For #52009.

Change-Id: I1b4cd85fa5ff920973552fc94977954f93622a32
Reviewed-on: https://go-review.googlesource.com/c/go/+/398059
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Bryan C. Mills 2022-04-01 15:55:56 -04:00 committed by Bryan Mills
parent 62bceae32d
commit 592078ff3f

View File

@ -303,7 +303,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
fmt.Fprintf(h, "fuzz %q\n", fuzzFlags)
}
}
fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
if p.Internal.BuildInfo != "" {
fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
}
// Configuration specific to compiler toolchain.
switch cfg.BuildToolchainName {