diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index bf91bb74ada..9a24733768b 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1507,7 +1507,13 @@ func isStale(p *Package) (bool, string) { // Package is stale if a dependency is. for _, p1 := range p.Internal.Deps { if p1.Stale { - return true, "stale dependency" + // Don't add "stale dependency" if it is + // already there. + if strings.HasPrefix(p1.StaleReason, "stale dependency") { + return true, p1.StaleReason + } + msg := fmt.Sprintf("stale dependency %s: %s", p1.Name, p1.StaleReason) + return true, msg } } @@ -1545,7 +1551,8 @@ func isStale(p *Package) (bool, string) { // Package is stale if a dependency is, or if a dependency is newer. for _, p1 := range p.Internal.Deps { if p1.Internal.Target != "" && olderThan(p1.Internal.Target) { - return true, "newer dependency" + msg := fmt.Sprintf("newer dependency %s ", p1.Internal.Target) + return true, msg } } @@ -1612,7 +1619,8 @@ func isStale(p *Package) (bool, string) { srcs := str.StringList(p.GoFiles, p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.CgoFiles, p.SysoFiles, p.SwigFiles, p.SwigCXXFiles) for _, src := range srcs { if olderThan(filepath.Join(p.Dir, src)) { - return true, "newer source file" + msg := fmt.Sprintf("newer source file %s", filepath.Join(p.Dir, src)) + return true, msg } }