Table of contents
1. Problem description
error message
go: xxx.com/[email protected] (replaced by git.xxx.com/app/[email protected]): Get "https://GOPRIVATE=git.xxx.com/git.xxx.com/app/go-util/@v/v1.0.20.mod": dial tcp: lookup GOPRIVATE=git.xxx.com: no such host
2. Solution
Cause of the problem: Go sets the default GOSUMDB=sum.golang.org, of course it cannot recognize the private domain name xxx.com. The solution is to execute the following command in the project path:
go env -w GOPRIVATE=git.xxx.com 或 go env -w GOSUMDB=off