Open jaronnie opened 12 months ago
Hi @jaronnie , please can yo provide some more information, e.g. on which project do you have run the provided command line, your OS and also your Go version.
Thanks Thomas
Hi @gen2thomas, also encountered this bug.
I believe it started to appear after switching from Go v1.19
to v1.21
when trying to run deptree
in any project that uses go mod vendor
.
It can be solved by adding -mod=readonly
or -mod=mod
to the go list
command.
When running in a project that uses vendor directory the problematic command go list -u -m -json all
, prints:
go: can't determine available upgrades using the vendor directory
(Use -mod=mod or -mod=readonly to bypass.)
After applying the fix with either go list -mod=readonly -u -m -json all
or go list -mod=mod -u -m -json all
we get the expected output with package list.
Above outputs were generated using go version go1.21.5 darwin/arm64
$ go mod graph | deptree -d 2 -t -a call 'go list -u -m -json all', be patient... 2023/07/14 10:48:35 exit status 1, go: updates to go.sum needed, disabled by -mod=readonly