Just lately I spent might hours on a quite simple drawback that could possibly be detected if go mod
had good logging.
I’ve two questions:
- You probably have issues with
go mod
orgo get
or different go tooling, how do you debug them? - How can we enhance the tooling to make it simpler.
I’ve been round for some time and each new go developer runs into issues with personal repos. Such as you don’t have entry to this, otherwise you don’t have entry to that. Tooling is sort of good with that drawback it may possibly instantly let you know one thing like:
If it is a personal repository, see https://golang.org/doc/faq#git_https
Which is nice. Nevertheless it doesn’t assist on a regular basis.
I would like some extra generic approach to get extra data on go mod
logic. For instance, the way it decides the place to go now? Was it GOPRIVATE who affected it’s logic, or GOPROXY? When it sends an https request, what modifiers does it makes use of?
In my case, I seen go mod
getting 404 for the endpoint that’s really publicly obtainable and return 200 OK once I ship a request utilizing curl
for the exact same command line.
I attempted eradicating .gitconfig
and .ssh/config
, however it didn’t assist. Turned out it was an outdated .netrc
file with login and password. And I discovered this solely after operating strace
and taking a look at all of the recordsdata go mod
opens.
It was fairly unusual for me that go by default reads .netrc and makes use of auth knowledge from it. On the identical time, there is no such thing as a help for SSLKEYLOGFILE
or http_proxy
setting variables, so even once I run wireshark to seize all the info I can’t decypher it, as a result of it’s TLS. Having a approach to drive go instruments to proxy their requests or to write down secrets and techniques in a file could be very good.
What do you concentrate on it? Ought to I create a characteristic request so as to add extra verbose debugging, or SSLKEYLOGFILE
/http_proxy
help? Or, maybe, you understand how to raised debug go mod
?
1 Like
To date, I’ve hardly ever encountered unusual issues, largely due to the community dial-up, equivalent to utilizing a proxy, organising a personal repository, closing the git certificates, and many others., are commonplace.
I don’t run into these points usually, however once I do, they’re irritating to determine. I don’t have a very good debugging methodology aside from brute-forcing adjustments.
That’s precisely what I’m speaking about! These points could possibly be actually difficult to debug.