@@ -652,8 +652,8 @@ func rawGoModData(m module.Version) (name string, data []byte, err error) {
652
652
if ! filepath .IsAbs (dir ) {
653
653
dir = filepath .Join (ModRoot (), dir )
654
654
}
655
- gomod : = filepath .Join (dir , "go.mod" )
656
- if gomodActual , ok := fsys .OverlayPath (gomod ); ok {
655
+ name = filepath .Join (dir , "go.mod" )
656
+ if gomodActual , ok := fsys .OverlayPath (name ); ok {
657
657
// Don't lock go.mod if it's part of the overlay.
658
658
// On Plan 9, locking requires chmod, and we don't want to modify any file
659
659
// in the overlay. See #44700.
@@ -662,16 +662,17 @@ func rawGoModData(m module.Version) (name string, data []byte, err error) {
662
662
data , err = lockedfile .Read (gomodActual )
663
663
}
664
664
if err != nil {
665
- return gomod , nil , module .VersionError (m , fmt .Errorf ("reading %s: %v" , base .ShortPath (gomod ), err ))
665
+ return "" , nil , module .VersionError (m , fmt .Errorf ("reading %s: %v" , base .ShortPath (name ), err ))
666
666
}
667
667
} else {
668
668
if ! semver .IsValid (m .Version ) {
669
669
// Disallow the broader queries supported by fetch.Lookup.
670
670
base .Fatalf ("go: internal error: %s@%s: unexpected invalid semantic version" , m .Path , m .Version )
671
671
}
672
+ name = "go.mod"
672
673
data , err = modfetch .GoMod (m .Path , m .Version )
673
674
}
674
- return "go.mod" , data , err
675
+ return name , data , err
675
676
}
676
677
677
678
// queryLatestVersionIgnoringRetractions looks up the latest version of the
0 commit comments