The module name should have been github.com/zeromq/goczmq/v4 instead of github.com/zeromq/goczmq for versions v4 and above (v4.1.0, v4.2.0, etc).
Since github.com/zeromq/goczmq has not adopted Go modules correctly, the go get will fail if Go 1.13 is used and the GOPROXY is set to direct or to some other server that does not host this file -
go get github.com/zeromq/[email protected]+incompatible
go: finding github.com v4.2.0+incompatible
go: finding github.com/zeromq v4.2.0+incompatible
go: finding github.com/zeromq/goczmq v4.2.0+incompatible
go: finding github.com/zeromq/goczmq v4.2.0+incompatible
go get github.com/zeromq/[email protected]+incompatible: github.com/zeromq/[email protected]+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required
More details mentioned under the 'Version validation' section here - https://golang.org/doc/go1.13#modules
Note - GoSUMDB also won't have such entries so even if you set the GOPROXY to a server that hosts this file and if GOSumDB is enabled, then you will get something like this -
➜ ~ export GOPROXY=https://gocenter.io
➜ ~ go get github.com/zeromq/[email protected]+incompatible
go: finding github.com/zeromq/goczmq v4.2.0+incompatible
go: finding github.com/zeromq v4.2.0+incompatible
go: finding github.com v4.2.0+incompatible
go: downloading github.com/zeromq/goczmq v4.2.0+incompatible
verifying github.com/zeromq/[email protected]+incompatible: github.com/zeromq/[email protected]+incompatible: reading https://gocenter.io/sumdb/sum.golang.org/lookup/github.com/zeromq/[email protected]+incompatible: 404 Not Found
The correct solution will be to follow up with the module author to make sure that they are adopting Go modules correctly by adding a suffix to the module name.
There is a workaround but have to check if it's working by design i.e. point GOPROXY to a server that hosts this file and then use GOPRIVATE to exclude this specific module version from GoSumDB validation -
root@715c3b39bb12:/go# export GOPROXY=https://gocenter.io
root@715c3b39bb12:/go# unset GOPRIVATE
root@715c3b39bb12:/go# go get github.com/zeromq/[email protected]+incompatible
go: finding github.com v4.2.0+incompatible
go: finding github.com/zeromq/goczmq v4.2.0+incompatible
go: finding github.com/zeromq v4.2.0+incompatible
go: downloading github.com/zeromq/goczmq v4.2.0+incompatible
verifying github.com/zeromq/[email protected]+incompatible: github.com/zeromq/[email protected]+incompatible: reading https://gocenter.io/sumdb/sum.golang.org/lookup/github.com/zeromq/[email protected]+incompatible: 404 Not Found
root@715c3b39bb12:/go# export GOPRIVATE=github.com/zeromq/goczmq
root@715c3b39bb12:/go# go get github.com/zeromq/[email protected]+incompatible
go: downloading github.com/zeromq/goczmq v4.2.0+incompatible
go: extracting github.com/zeromq/goczmq v4.2.0+incompatible
# pkg-config --cflags -- libczmq libzmq libsodium
Package libczmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libczmq.pc'
However, will still recommend reaching out to the module author to fix the module name in their go.mod file.