-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.early-in-cycleA change that should be done early in the 3 month dev cycle.A change that should be done early in the 3 month dev cycle.modules
Milestone
Description
What version of Go are you using (go version
)?
$ go version go version go1.11.4 darwin/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 GOARCH="amd64" GOBIN="/Users/sunliver/go/bin" GOCACHE="/Users/sunliver/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/sunliver/go" GOPROXY="" GORACE="" GOROOT="/usr/local/Cellar/go/1.11.4/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.11.4/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" 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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/r3/fxzm7n8s0497vkmvnj0qygkr0000gp/T/go-build192454760=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
- export GO111MODULE=on
mkdir -p ~/go/project/src/github.com/sunliver/pkg1 && cd ~/go/project/src/github.com/sunliver/pkg1 && touch Gopkg.lock Gopkg.toml
~/go
is default module GOPATH
the project under module GOPATH is required- run
go env GOMOD
you will get
/Users/sunliver/go/project/src/github.com/sunliver/pkg1/go.mod
though thego.mod
file doesn't exist
further:
- export GO111MODULE=on && export GOPATH=~/go/project
- create simple hello.go under
pkg1
and rungo build
you will get ago.mod
file fromGopkg.lock
What did you expect to see?
GOMOD left unset
What did you see instead?
/Users/sunliver/go/project/src/github.com/sunliver/pkg1/go.mod
Though building legacy GOPATH project when GO111MODULE is on is confusing, I hope at least GOMOD left unset and go build
will not auto generate the go.mod
file. Maybe give a warning or error instead.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.early-in-cycleA change that should be done early in the 3 month dev cycle.A change that should be done early in the 3 month dev cycle.modules