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

rogpeppe opened this issue Aug 1, 2018 · 1 comment


None yet
1 participant
Copy link

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
go: creating new go.mod: module
% echo 'package example; import _ ""' > example.go
% go build
% go mod -graph -json
	"Module": {
		"Path": ""
	"Require": [
			"Path": "",
			"Version": "v2.2.1"
	"Exclude": null,
	"Replace": null

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


This comment has been minimized.

Copy link
Contributor Author

commented Aug 1, 2018

This is now invalid because 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.