Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: vgo list -m -json all is not valid json #26364

Closed
flibustenet opened this issue Jul 13, 2018 · 2 comments
Closed

cmd/go: vgo list -m -json all is not valid json #26364

flibustenet opened this issue Jul 13, 2018 · 2 comments

Comments

@flibustenet
Copy link

What version of Go are you using (go version)?

vgo today

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

linux

What did you do?

$ vgo list -m -json all

What did you expect to see?

[
  {
	"Path": "test",
	"Main": true,
	"Dir": "/tmp/t"
  },
  {
	"Path": "github.com/gorilla/context",
	"Version": "v1.1.1",
	"Time": "2016-08-17T18:46:32Z",
	"Indirect": true,
	"Dir": "/home/wilk/go/src/mod/github.com/gorilla/context@v1.1.1"
  },
  {
	"Path": "github.com/gorilla/mux",
	"Version": "v0.0.0-20180605211556-cb4698366aa6",
	"Time": "2018-06-05T21:15:56Z",
	"Dir": "/home/wilk/go/src/mod/github.com/gorilla/mux@v0.0.0-20180605211556-cb4698366aa6"
  }
]

What did you see instead?

{
	"Path": "test",
	"Main": true,
	"Dir": "/tmp/t"
}
{
	"Path": "github.com/gorilla/context",
	"Version": "v1.1.1",
	"Time": "2016-08-17T18:46:32Z",
	"Indirect": true,
	"Dir": "/home/wilk/go/src/mod/github.com/gorilla/context@v1.1.1"
}
{
	"Path": "github.com/gorilla/mux",
	"Version": "v0.0.0-20180605211556-cb4698366aa6",
	"Time": "2018-06-05T21:15:56Z",
	"Dir": "/home/wilk/go/src/mod/github.com/gorilla/mux@v0.0.0-20180605211556-cb4698366aa6"
}
@dominikh
Copy link
Member

It is a stream of JSON objects. This form makes it easy to produce and consume the output without having to a) buffer all the data or b) emit individual tokens.

At most, this justifies a documentation change in go help list, but I'm not convinced of that, either.

@flibustenet
Copy link
Author

I understand, it's ok then

@golang golang locked and limited conversation to collaborators Jul 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants