We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f42a9b commit d2b436dCopy full SHA for d2b436d
src/cmd/go/internal/modload/init.go
@@ -1018,7 +1018,7 @@ func keepSums(addDirect bool) map[module.Version]bool {
1018
}
1019
1020
for _, pkg := range loaded.pkgs {
1021
- if pkg.testOf != nil || pkg.inStd {
+ if pkg.testOf != nil || pkg.inStd || module.CheckImportPath(pkg.path) != nil {
1022
continue
1023
1024
for prefix := pkg.path; prefix != "."; prefix = path.Dir(prefix) {
src/cmd/go/testdata/script/mod_import_issue42891.txt
@@ -0,0 +1,14 @@
1
+# If an import declaration is an absolute path, most commands should report
2
+# an error instead of going into an infinite loop.
3
+# Verifies golang.org/issue/42891.
4
+go list .
5
+stdout '^m$'
6
+
7
+-- go.mod --
8
+module m
9
10
+go 1.16
11
+-- m.go --
12
+package m
13
14
+import "/"
0 commit comments