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: errors about netrc need go prefix #70537

Closed
rsc opened this issue Nov 23, 2024 · 4 comments
Closed

cmd/go: errors about netrc need go prefix #70537

rsc opened this issue Nov 23, 2024 · 4 comments
Labels
BadErrorMessage Issues related compiler error messages that should be better. FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Nov 23, 2024

I ran 'go test' in a subprocess with no environment at all (accidentally), and it failed with

could not parse netrc (GOAUTH=netrc): $HOME is not defined

The usual convention is that calls to base.Fatalf need to provide a 'go: ' prefix in the error.
The ones in auth should be fixed.

/cc @matloob @samthanawalla

@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Nov 23, 2024
@rsc rsc added this to the Go1.24 milestone Nov 23, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/631535 mentions this issue: cmd/go: add go prefix in base.Fatalf

@cuishuang
Copy link
Contributor

The error message here comes from

dir, err := os.UserHomeDir()

If no environment variables are set, os.UserHomeDir() will return an error. I wonder if we need to add a logic here to get the result of cd ~ && pwd and try to find the .netrc file in that path.

@dmitshur dmitshur added GoCommand cmd/go BadErrorMessage Issues related compiler error messages that should be better. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Dec 1, 2024
gopherbot pushed a commit that referenced this issue Dec 2, 2024
For #70537

Change-Id: I20e239611f07aa13915367c3a44994a43b5482d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/631535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Veronica Silina <veronicasilina@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
@cuishuang
Copy link
Contributor

This issue can be closed now because #CL631535 has been merged.

@ianlancetaylor
Copy link
Contributor

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BadErrorMessage Issues related compiler error messages that should be better. FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants