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: use quiet flag to allow tool integrations with Go modules #26628

Closed
marwan-at-work opened this issue Jul 26, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@marwan-at-work
Copy link
Contributor

commented Jul 26, 2018

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

Tip - Darwin

What did you do?

go list -m -versions -json github.com/pkg/errors@latest to list all the available upstream versions

What did you expect to see?

I'd like to only get the JSON output and not mod-fetching output.
The boolean QuietLookup in modfetch/cache.go is not being set anywhere which is causing the following to show

What did you see instead?

go: finding github.com/pkg/errors v0.8.0
{
	"Path": "github.com/pkg/errors",
	"Version": "v0.8.0",
	"Versions": [
		"v0.1.0",
		"v0.2.0",
		"v0.3.0",
		"v0.4.0",
		"v0.5.0",
		"v0.5.1",
		"v0.6.0",
		"v0.7.0",
		"v0.7.1",
		"v0.8.0"
	],
	"Time": "2016-09-29T01:48:01Z"
}
@oiooj

This comment has been minimized.

Copy link
Member

commented Jul 28, 2018

I think "go list -m" always need QuietLookup = true, maybe we don't need a quiet flag.

@myitcv

This comment has been minimized.

Copy link
Member

commented Jul 31, 2018

Please can you confirm the full env details here (you've abbreviated the template) - what commit were you using etc?

I can't reproduce the issue you're seeing based on the steps above either.

In any case, stdout should always contain valid JSON, per #26218 (comment)

@marwan-at-work

This comment has been minimized.

Copy link
Contributor Author

commented Jul 31, 2018

@myitcv I believe I was parsing both stderr and stdout, so I'll try again with just stdout and it should probably work. That being said, maybe the CL is still ok to have control over the QuietLookup variable in cache. Otherwise, using stdout is fine for my usecase. Thanks

@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Aug 3, 2018

@myitcv

This comment has been minimized.

Copy link
Member

commented Aug 7, 2018

@marwan-at-work - I'm going to close per #26628 (comment), but please shout if you're seeing behaviour contrary to #26218 (comment)

@myitcv myitcv closed this Aug 7, 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.