Sometimes, publishing the Go library will find that it cannot be referenced in other projects, resulting in a 410 Gone error.

This is because your GO library is declared in go 1.12 format and there will be no SUMDB validation information, so a reference to such an old library format in a Go 1.13 project will generate a validation error and result in an error of 410 Gone.

Such as:

There are many solutions.

For those of you who use the old format library, there are two ways to help you download the library and complete the reference:

export GONOSUMDB="github.com/hedzr/errors,$GONOSUMDB"
# Or
export GOSUMDB=off
Copy the code

For the owner of the library, the following is the correct solution to solve the problem once and for all: change the version format of the library declaration to 1.13 in go.mod. Such as:

module github.com/hedzr/errors

go 1.13  / / go 1.12

Copy the code

For library authors, if there are any other published libraries whose go.mod contains the go 1.12 declaration, they should immediately update the library to the new version and fix the declaration to Go 1.13 to avoid trouble for others.