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: go mod -graph -json prints both JSON and graph. #26742

Closed
rogpeppe opened this issue Aug 1, 2018 · 1 comment
Closed

cmd/go: go mod -graph -json prints both JSON and graph. #26742

rogpeppe opened this issue Aug 1, 2018 · 1 comment

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Aug 1, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +870b838915 Tue Jul 31 08:41:46 2018 +0100 linux/amd64

% cd /tmp
% mkdir testmod
% cd testmod
% go mod -init -module example.com/example
go: creating new go.mod: module example.com/example
% echo 'package example; import _ "gopkg.in/yaml.v2"' > example.go
% go build
% go mod -graph -json
{
	"Module": {
		"Path": "example.com/example"
	},
	"Require": [
		{
			"Path": "gopkg.in/yaml.v2",
			"Version": "v2.2.1"
		}
	],
	"Exclude": null,
	"Replace": null
}
example.com/example gopkg.in/yaml.v2@v2.2.1
gopkg.in/yaml.v2@v2.2.1 gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405

I was expecting to see a JSON representation of the graph output. Instead, we get both the JSON output from "go mod -json" and the graph output in non-JSON form.

@rogpeppe
Copy link
Contributor Author

rogpeppe commented Aug 1, 2018

This is now invalid because https://go-review.googlesource.com/c/go/+/126655 has split -graph out into a separate subcommand that no longer takes a -json flag.

@rogpeppe rogpeppe closed this as completed Aug 1, 2018
@golang golang locked and limited conversation to collaborators Aug 1, 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

2 participants