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
$ go versiongo version go1.12 linux/amd64
$ go list -json ./...go: finding github.com/…… fatal: unable to access 'https://github.com/…': Could not resolve host: github.com
→ No useful output. I don’t care if some json fields would be better populated with network access, just because you ask json output does not mean you will use every single json field.
Ironically, go mod edit does not have this module-induced problem
$ go mod edit -fmt -json go.mod
→ just works.
Lastly:
$ GO111MODULE=off go list -json ./...
→ works but GO111MODULE is going away and in off mode go list does not list the go.mod files that could be fed to go mod edit -fmt -json for parsing
go list -json needs a pure passive mode that does not change files on disk or attempts to download other things, similar to go mode edit -json -fmt
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
go list needs a -fmt -json mode like go mod edit
cmd/go: go list needs a -fmt -json mode like go mod edit
Mar 1, 2019
-fmt is the wrong name for go mod edit too, it's not really a formatting option, it's a “passive static read only mode no update no internet access no clever anything, just read existing available files as they are without changing them or completing them or whatever and report”
→ No useful output. I don’t care if some json fields would be better populated with network access, just because you ask json output does not mean you will use every single json field.
Ironically,
go mod edit
does not have this module-induced problem$ go mod edit -fmt -json go.mod
→ just works.
Lastly:
$ GO111MODULE=off go list -json ./...
→ works but
GO111MODULE
is going away and in off modego list
does not list thego.mod
files that could be fed togo mod edit -fmt -json
for parsinggo list -json
needs a pure passive mode that does not change files on disk or attempts to download other things, similar togo mode edit -json -fmt
The text was updated successfully, but these errors were encountered: