diff options
Diffstat (limited to 'src/cmd/go/internal/load/pkg.go')
-rw-r--r-- | src/cmd/go/internal/load/pkg.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index de3f5b8fa2..873abe07a0 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -395,7 +395,11 @@ const ( // disallowVendor will reject direct use of paths containing /vendor/. ResolveImport = 1 << iota - // getTestDeps is for download (part of "go get") and indicates + // ResolveModule is for download (part of "go get") and indicates + // that the module adjustment should be done, but not vendor adjustment. + ResolveModule + + // GetTestDeps is for download (part of "go get") and indicates // that test dependencies should be fetched too. GetTestDeps ) @@ -425,6 +429,9 @@ func LoadImport(path, srcDir string, parent *Package, stk *ImportStack, importPo // The code is also needed in a few other places anyway. path = ResolveImportPath(parent, path) importPath = path + } else if mode&ResolveModule != 0 { + path = ModuleImportPath(parent, path) + importPath = path } p := packageCache[importPath] |