-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Description
What version of Go are you using (go version)?
$ go version go version go1.13rc1 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="/home/leighmcculloch/local/bin" GOCACHE="/home/leighmcculloch/.cache/go-build" GOENV="/home/leighmcculloch/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/leighmcculloch/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/leighmcculloch/local/bin/go/1.13rc1" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/leighmcculloch/local/bin/go/1.13rc1/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/leighmcculloch/devel/test/go.mod" 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-build816830480=/tmp/go-build -gno-record-gcc-switches"
What did you do?
I run go mod tidy on the following code.
go.mod:
module test
go 1.13
require (
github.com/throttled/throttled v2.2.2+incompatible
)
replace github.com/throttled/throttled v2.2.2+incompatible => github.com/bartekn/throttled v2.2.3-0.20181102161246-c99eef3ad70a+incompatible
main.go:
package main
import (
"fmt"
"github.com/throttled/throttled"
)
func main() {
fmt.Println(throttled.HTTPRateLimiter{})
}What did you expect to see?
I expected go mod tidy to exit status code of success (0).
$ go mod tidy
$ echo $?
0
What did you see instead?
The go mod tidy command had a failure exit status code (1) and a 410 Gone error message.
$ go mod tidy
go: downloading github.com/throttled/throttled v2.2.2
verifying github.com/throttled/throttled@v2.2.2: github.com/throttled/throttled@v2.2.2: reading https://sum.golang.org/lookup/github.com/throttled/throttled@v2.2.2: 410 Gone
$ echo $?
1
If I visit the URL https://sum.golang.org/lookup/github.com/throttled/throttled@v2.2.2 it returns the text:
not found: invalid version
If I remove the replace directive, go mod tidy returns success and there is no verifying error message. The output in the section above where the exit status is 0 is what I see when the replace statement is removed. The problem I'm experiencing is isolated to when the replace directive is in use.
The version of the throttled package is v2.2.2+incompatible and so if the tool wants to query the sumdb about it, it should be attempting to query the URL https://sum.golang.org/lookup/github.com/throttled/throttled@v2.2.2+incompatible, but for some reason it is attempting to go to the URL without the +incompatible suffix.
It also seems strange that it is attempting to download the source package when I have a replace directive present pointing to the fork. Possibly it shouldn't be doing that either?
Context
The above example is a reduced example of an error I'm seeing while I'm trying to migrate a larger Go repo from dep to Modules (stellar/go#1634).