cmd/go: confusing error when trying to build a package conflicting with an std import path #32576
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?go version go1.12.5 linux/amd64
Does this issue reproduce with the latest release?
Yes. Latest version of Go without this issue is 1.7.
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build789582237=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Steps to reproduce:
Create vendor package:
$ dep init
Create Docker file:
docker build .
What did you expect to see?
App should be built.
What did you see instead?
unexpected directory layout:
import path: cloud.google.com/go/compute/metadata
root: /go/src
dir: /go/src/plugin/vendor/cloud.google.com/go/compute/metadata
expand root: /go/src
expand dir: /go/src/plugin/vendor/cloud.google.com/go/compute/metadata
separator: /
Looks that for some reason 'plugin' name is reserved. If in Docker file I replace it by any other word, then it works.
I'm not against reserved package name, but in such case error message should be useful. In this case I have spent whole day on debugging this issue.
The text was updated successfully, but these errors were encountered: