You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On attempt to analyse a project the error occurred:
❯ gomod analyse -v
17:11:16 debug graph Creating dependency graph.
17:11:16 debug modinfo Ensuring module information is available locally by running 'go mod download'.
17:11:16 debug modinfo Running command. {"args": ["/usr/local/bin/go", "go", "mod", "download"]}
17:11:16 debug modinfo Finished running. {"args": ["/usr/local/bin/go", "go", "mod", "download"], "stdout": "", "stderr": ""}
17:11:16 debug modinfo Retrieving module information via 'go list'
17:11:16 debug modinfo Running command. {"args": ["/usr/local/bin/go", "go", "list", "-json", "-m", "all"]}
go list -m: can't compute 'all' using the vendor directory
(Use -mod=mod or -mod=readonly to bypass.)
17:11:16 debug modinfo Finished running. {"args": ["/usr/local/bin/go", "go", "list", "-json", "-m", "all"], "stdout": "", "stderr": "go list -m: can't compute 'all' using the vendor directory\n\t(Use -mod=mod or -mod=readonly to bypass.)\n"}
17:11:16 error modinfo Command exited with an error. {"args": ["/usr/local/bin/go", "go", "list", "-json", "-m", "all"], "error": "exit status 1"}
17:11:16 error modinfo Failed to list modules in dependency graph via 'go list'. {"error": "failed to run 'go list -json -m all: exit status 1"}
Error: failed to run 'go list -json -m all: exit status 1
Usage:
gomod analyse [flags]
Aliases:
analyse, analyze
Flags:
-h, --help help for analyse
Global Flags:
-v, --verbose strings[=all] Verbose output. See 'gomod --help' for more information.
17:11:16 debug all Exited with an error. {"error": "failed to run 'go list -json -m all: exit status 1"}
Adding suggested option-mod=mod to arguments list at internal/modules/modules.go:81 and internal/depgraph/deps_pkg.go:146 solves the problem.
Hello @alexeykiselev. Thank you for the report, and a solution with it nonetheless! gomod had indeed not yet been tested on projects using vendoring and this is why this bug had slipped through.
I will use your solution as is as it entirely makes sense. 👍
OS: macOS 10.15.7
I've tried
gomod
version 0.7.0 and latest master.On attempt to analyse a project the error occurred:
Adding suggested option
-mod=mod
to arguments list atinternal/modules/modules.go:81
andinternal/depgraph/deps_pkg.go:146
solves the problem.The text was updated successfully, but these errors were encountered: