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

Comments

Projects
None yet
1 participant
@rogpeppe
Copy link
Contributor

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 rogpeppe added the modules label Aug 1, 2018

@rogpeppe

This comment has been minimized.

Copy link
Contributor Author

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 Aug 1, 2018

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.