Looking at it again, I'm guessing the part where sum.golang.org/lookup tries to query my behind-netbird server is why the lookup is failing. But is there a way to gave Go not rely on an external service like that? Or have it run the query locally instead of from the sum.golang.org server?
Golang
This is a community dedicated to the go programming language.
Useful Links:
Rules:
- Posts must be relevant to Go
- No NSFW content
- No hate speech, bigotry, etc
- Try to keep discussions on topic
- No spam of tools/companies/advertisements
- It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
This is my first guess, and a facet of my single biggest criticism of Go: the module system they added has an enabled-by-default policy of phoning home to Google servers, which turned an otherwise decent toolchain into spyware.
The GOPRIVATE environment variable may be what you need to avoid that error.
Yup this fixed it -- adding GOPRIVATE=code.mydomain.com as an environment variable allowed go get and go mod tidy to work with my private repos.
Is there a way to set this globally, or to configure Go to always treat any references to code.mydomain.com as a private URL?
The go env -w command can make most go environment variable settings persistent for the current user. Alternatively, you could set the environment variable in your shell's login script.
Be sure to read go's docs for individual environment variables, because go doesn't respect all methods of setting them in every case. (For example, it ignores certain approaches to disabling its telemetry. How convenient for Google.)
I don't know if this will help, but I documented how to configure my Caddy webserver to serve golang vanity URLs here.