summaryrefslogtreecommitdiffstats
path: root/src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:19:13 +0000
commitccd992355df7192993c666236047820244914598 (patch)
treef00fea65147227b7743083c6148396f74cd66935 /src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt
parentInitial commit. (diff)
downloadgolang-1.21-ccd992355df7192993c666236047820244914598.tar.xz
golang-1.21-ccd992355df7192993c666236047820244914598.zip
Adding upstream version 1.21.8.upstream/1.21.8
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt')
-rw-r--r--src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt b/src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt
new file mode 100644
index 0000000..e2c5cf9
--- /dev/null
+++ b/src/cmd/go/testdata/script/list_import_cycle_deps_errors.txt
@@ -0,0 +1,75 @@
+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" \ No newline at end of file