go version && go envgo version output:
go version devel +bc593eac2d Mon Jul 1 14:45:49 2019 +0000 linux/amd64
go env output:
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/u/.cache/go-build"
GOENV="/home/u/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/u/goget:/home/u/Desktop/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/u/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/u/go1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build741963370=/tmp/go-build -gno-record-gcc-switches"
On the latest version of Go (which uses proxy.golang.org) it seems like go get is resulting in a 410 HTTP error.
$ go get github.com/golangci/golangci-lint/cmd/golangci-lint
go: finding github.com/golangci/golangci-lint/cmd/golangci-lint latest
verifying github.com/go-critic/[email protected]/go.mod: github.com/go-critic/[email protected]/go.mod: reading https://sum.golang.org/lookup/github.com/go-critic/[email protected]: 410 Gone
Related to this issue, on our CI builds we've started to notice 400 HTTP error (Bad Request) reported by proxy.golang.org for the go-critic dependency of golangci-lint.
ref: https://travis-ci.org/llir/llvm/jobs/552889788
$ go get github.com/golangci/golangci-lint/cmd/golangci-lint
go: finding github.com/mattn/goveralls v0.0.2
go: downloading github.com/mattn/goveralls v0.0.2
go: extracting github.com/mattn/goveralls v0.0.2
go: finding github.com/golangci/golangci-lint/cmd/golangci-lint latest
go: finding github.com/golangci/golangci-lint v1.17.1
go: downloading github.com/golangci/golangci-lint v1.17.1
go: extracting github.com/golangci/golangci-lint v1.17.1
go get: github.com/golangci/[email protected] requires
github.com/go-critic/[email protected]: reading https://proxy.golang.org/github.com/go-critic/go-critic/@v/v0.0.0-20181204210945-1df300866540.mod: 400 Bad Request
The command "go get github.com/golangci/golangci-lint/cmd/golangci-lint" failed and exited with 1 during .
Edit: It seems like other dependencies of golangci-lint have similar issues when using proxy.golang.org:
$ go get github.com/golangci/golangci-lint/cmd/golangci-lint
go: finding github.com/golangci/golangci-lint/cmd/golangci-lint latest
verifying github.com/golangci/[email protected]/go.mod: github.com/golangci/[email protected]/go.mod: reading https://sum.golang.org/lookup/github.com/golangci/[email protected]: 410 Gone
It also seems that on Go 1.13 (tip), it is not possible to go get golangci-lint, even when configuring GOPROXY=direct and GOSUMDB=off.
$ GOPROXY=direct GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/golangci-lint
go: finding github.com/golangci/golangci-lint/cmd/golangci-lint latest
go: finding github.com/golangci/golangci-lint/cmd latest
go: downloading github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98
go: downloading github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540
go: downloading github.com/gogo/protobuf v1.1.1
go: downloading github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc
go: extracting github.com/gogo/protobuf v1.1.1
build github.com/golangci/golangci-lint/cmd/golangci-lint: cannot load github.com/go-critic/go-critic/checkers: github.com/go-critic/[email protected]: invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)
I've submitted a PR that fixes the issue
https://github.com/golangci/golangci-lint/pull/605
I have similar issue too:
build github.com/golangci/golangci-lint/cmd/golangci-lint: cannot load github.com/golangci/gofmt/gofmt: unexpected status (https://proxy.golang.org/github.com/golangci/gofmt/@v/v0.0.0-20181105071733-0b8337e80d98.zip): 410 Gone
Makefile:32: recipe for target 'verify' failed
make: *** [verify] Error 1
+ EXIT_VALUE=2
+ set +o xtrace
Pretty sure this is the same issue, but our circleci broke earlier this week, with errors such as:
go: github.com/golangci/[email protected]: unexpected status (https://proxy.golang.org/github.com/golangci/lint-1/@v/v0.0.0-20180610141402-ee948d087217.info): 410 Gone
Digging into the server response, the actual underlying problem is that the pseudo version doesn't match due to the timestamp being different. Going directly to https://proxy.golang.org/github.com/golangci/lint-1/@v/v0.0.0-20180610141402-ee948d087217.info gives:
not found: github.com/golangci/[email protected]: invalid pseudo-version: does not match version-control timestamp (2019-04-20T13:22:49Z)
From what I understand, go1.13 is stricter than go1.12 about timestamps matching, and the proxy has adopted the same behavior.
I was able to work around these build problems using a series of replace statements in go.mod:
replace github.com/go-critic/go-critic v0.0.0-20181204210945-c3db6069acc5 => github.com/go-critic/go-critic v0.0.0-20190422201921-c3db6069acc5
replace github.com/go-critic/go-critic v0.0.0-20181204210945-ee9bf5809ead => github.com/go-critic/go-critic v0.0.0-20190210220443-ee9bf5809ead
replace github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
replace github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196
replace github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
replace github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
replace github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
Im able to resolve the issue by setting GOPROXY=direct
@dustmop thanks for that 馃檭
for v1.17.1 I had to tweak to:
replace github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
replace github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196
replace github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
replace github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
replace github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
replace github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540 => github.com/go-critic/go-critic v0.0.0-20190526074819-1df300866540
replace mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
replace github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc => github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc
for master I had to add:
replace github.com/timakin/bodyclose => github.com/golangci/bodyclose v0.0.0-20190714144026-65da19158fa2
Hmm. I wish I had found this about 10 minutes ago. ;-)
FWIW, using Go 1.13, these steps fail with an "invalid pseudo-version" error:
export GOPATH=$(mktemp -d) # using fresh module cache
cd $(mktemp -d)
go mod init example.com/tempmod
go get github.com/golangci/golangci-lint/cmd/[email protected]
which reports error:
go: extracting github.com/golangci/golangci-lint v1.17.1
go get: github.com/golangci/[email protected] requires
github.com/go-critic/[email protected]:
invalid pseudo-version: does not match version-control timestamp (2019-05-26T07:48:19Z)
If we follow the advice from the section of the Go 1.13 release notes on resolving version validation issues (https://golang.org/doc/go1.13#version-validation), we can make that same 'go get' work:
# re-do setup from scratch
export GOPATH=$(mktemp -d) # using fresh module cache
cd $(mktemp -d)
go mod init example.com/tempmod
# create 'replace' statements using *just* the commit hashes
# for each problematic module on the right-hand side
echo 'replace github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540 => github.com/go-critic/go-critic 1df300866540' >> go.mod
echo 'replace github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck ef45e06d44b6' >> go.mod
echo 'replace github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools af6baa5dc196' >> go.mod
echo 'replace github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt 0b8337e80d98' >> go.mod
echo 'replace github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec 66fb7fc33547' >> go.mod
echo 'replace github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc => github.com/golangci/ineffassign 42439a7714cc' >> go.mod
echo 'replace github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 ee948d087217' >> go.mod
echo 'replace mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam fbb59629db34' >> go.mod
This now works:
```
go get github.com/golangci/golangci-lint/cmd/[email protected]
````
Hi, sorry for slow fixing.
Go1.13 compatibility was introduced in the latest v1.18.0 release
Most helpful comment
Hi, sorry for slow fixing.
Go1.13 compatibility was introduced in the latest v1.18.0 release