cmd/go: support both .netrc and _netrc under windows #66832
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go version go1.22.1 windows/amd64
Output of
go env
in your module/workspace:What did you do?
I have
%USERPROFILE%\.netrc
with proper credentials, and then:What did you see happen?
What did you expect to see?
Download succeeds. It works if I copy:
%USERPROFILE%\.netrc
to
%USERPROFILE%\_netrc
Code in go expects
_netrc
:go/src/cmd/go/internal/auth/netrc.go
Line 90 in fa98f46
While e.g.
curl
library (used by e.g. git and other tools) reads first.netrc
file and fallbacks to_netc
if not found:https://github.com/curl/curl/blob/49f83c30e43749752072c65a43d553eb015453d1/docs/cmdline-opts/netrc.md?plain=1#L28
This functionality was added in curl/curl@f9c7ba9
Found issue when adding go support to some tooling, everything else was working but not go.
There seem to be no one convention how those files should be named (e.g. bazel seems to look only for
.netrc
- code), but probably being compatible with curl way is most appropriate.For reference, issue on go that lead to adding support of _netrc under windows: #24606
The text was updated successfully, but these errors were encountered: