Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: modules can't install a binary unless there is a go.mod in the current directory #26992

Closed
markbates opened this issue Aug 14, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@markbates
Copy link

commented Aug 14, 2018

When trying to install a binary using go get the installation fails when GO111MODULE=on and the directory you are in does not contain a go.mod file.

This only fails when GO111MODULE=on, otherwise the go get is successful and binary is installed.

What version of Go are you using (go version)?

go version go1.11rc1 darwin/amd64
GO111MODULE=on

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/markbates/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/markbates/Dropbox/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/6m/vw2ck7mj32z5f63wpgfw5qk80000gn/T/go-build733373769=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

export GO111MODULE=on
go1.11.rc1 get -v github.com/gobuffalo/buffalo/buffalo
$GOPATH/bin/buffalo version

What did you expect to see?

v0.12.5

What did you see instead?

go: cannot find main module; see 'go help modules'
@myitcv

This comment has been minimized.

Copy link
Member

commented Aug 14, 2018

This is, I think, a variant of #24250

@andybons

This comment has been minimized.

Copy link
Member

commented Aug 15, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Aug 23, 2018

Yes, this is a dup of #24250.

@bcmills bcmills closed this Aug 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.