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

Comments

Projects
None yet
2 participants
@flibustenet
Copy link

commented Jul 13, 2018

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

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

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

This comment has been minimized.

Copy link
Author

commented Jul 13, 2018

I understand, it's ok then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.