The problem and solution of “410 gone” prompted by golang’s go get private library


I haven’t used the private library before, but I happened to encounter it today. Let’s sort out the solution

Error record

If you are using the go get private library, you will encounter the following error:


$ export GO111MODULE=on
$ export GOPROXY=direct
$ export GOSUMDB=off

Both go111module and goproxy are familiar, while gosumdb is described as follows:

We know that go will create one locally when go module is enabled go.sum File used to store encrypted checksums that depend on a specific version of the package. At the same time, go maintains the cache of downloaded packages, and calculates and records the encrypted checksums of each package when downloading. In normal operation, the go command checks against these precomputed checksums go.sum Files instead of recalculating them every time a command is called.

In daily development, the checksums for specific module versions never change. Each time you run or build, the go command passes through the local go.sum To check whether the checksums of its local cache copies are consistent. If the checksums do not match, the go command reports a security error and refuses to run the build or run. In this case, it’s important to find the correct checksums and make sure they are go.sum Error or download code is wrong. If go.sum If there is no downloaded module in, and the module is a public module, the go command will query the go checksums database to obtain the correct checksums and save the go.sum 。 If the downloaded code does not match the checksums, the go command reports the mismatch and exits.

Go 1.13 provides the gosumdb environment variable for configuring the service address (and public key) of the go checksums database. The default value is ”This is also the official check sum database service provided by go (gopher in mainland China can use it .cn)。

For safety reasons, it is recommended to keep gosumdb on. But if, for some reason, gosumdb cannot be accessed (or even . CN), which can be turned off by the following command:

go env -w GOSUMDB=off

After gosumdb is shut down, only local go.sum Check and verify the packet.

Parameter test article:


Knowledge points supplement:

Solutions to go get timeout

go get . V2 timed out. It was found that it was blocked. The solution is as follows:

1. Installation

$ mkdir -p $GOPATH/src/
$ git clone $GOPATH/src/
$ go install net

2. Installation .v2

$ go get


The above is the details of the problem and solution of “410 gone” prompted by golang’s go get private library. For more information about go get private library, please pay attention to other related articles in developeppaer!

Recommended Today

Java security framework

The article is mainly divided into three parts1. The architecture and core components of spring security are as follows: (1) authentication; (2) authority interception; (3) database management; (4) authority caching; (5) custom decision making; and;2. To build and use the environment, the current popular spring boot is used to build the environment, and the actual […]