| Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 Path : /opt/golang/1.22.0/src/cmd/go/testdata/script/ |
| Current File : //opt/golang/1.22.0/src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt |
go list -e -deps -json=ImportPath,Error,DepsErrors m/a
cmp stdout want
-- want --
{
"ImportPath": "m/c",
"DepsErrors": [
{
"ImportStack": [
"m/a",
"m/b",
"m/c",
"m/a"
],
"Pos": "",
"Err": "import cycle not allowed"
}
]
}
{
"ImportPath": "m/b",
"DepsErrors": [
{
"ImportStack": [
"m/a",
"m/b",
"m/c",
"m/a"
],
"Pos": "",
"Err": "import cycle not allowed"
}
]
}
{
"ImportPath": "m/a",
"Error": {
"ImportStack": [
"m/a",
"m/b",
"m/c",
"m/a"
],
"Pos": "",
"Err": "import cycle not allowed"
},
"DepsErrors": [
{
"ImportStack": [
"m/a",
"m/b",
"m/c",
"m/a"
],
"Pos": "",
"Err": "import cycle not allowed"
}
]
}
-- go.mod --
module m
go 1.21
-- a/a.go --
package a
import _ "m/b"
-- b/b.go --
package b
import _ "m/c"
-- c/c.go --
package c
import _ "m/a"