Closed
Description
What version of Go are you using (go version
)?
[k9 test] $ go version
go version go1.11 linux/amd64
What operating system and processor architecture are you using (go env
)?
[k9 test] $ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hoenig/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/hoenig/Documents/go"
GOPROXY="file://tmp/foo"
GORACE=""
GOROOT="/opt/google/go"
GOTMPDIR=""
GOTOOLDIR="/opt/google/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/hoenig/Documents/go/src/github.com/shoenig/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-build114829655=/tmp/go-build -gno-record-gcc-switches"
What did you do?
When serving modules through a proxy (toy code below using 1 module served via file://), the go command seems to be making requests with a mangled URL (e.g. capital letters get weird).
If possible, provide a recipe for reproducing the error.
First, showing nothing bad happens if we use no proxy:
[k9 test] $ export GO111MODULE=on
[k9 test] $ go mod init
go: creating new go.mod: module github.com/shoenig/test
[k9 test] $ go mod edit -require github.com/BurntSushi/toml@v0.0.0-20170626110600-a368813c5e64
[k9 test] $ go build
go: finding github.com/BurntSushi/toml v0.0.0-20170626110600-a368813c5e64
Now, we set GOPROXY to a custom value, it does not matter what the value is.
[k9 test] $ export GOPROXY=file:///dev/null
[k9 test] $ go build
go: finding github.com/BurntSushi/toml v0.0.0-20170626110600-a368813c5e64
go: github.com/BurntSushi/toml@v0.0.0-20170626110600-a368813c5e64: open /dev/null/github.com/!burnt!sushi/toml/@v/v0.0.0-20170626110600-a368813c5e64.info: not a directory
go: error loading module requirements
Notice that go
is making a request for github.com/!burnt!sushi/toml
instead of github.com/BurntSushi/toml
.
Activity
AlexRouSg commentedon Sep 1, 2018
This is documented behavior, see:
https://tip.golang.org/cmd/go/#hdr-Module_proxy_protocol
myitcv commentedon Sep 1, 2018
Closing per @AlexRouSg's response