Navigation Menu

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
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@markbates
Copy link

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
Copy link
Member

myitcv commented Aug 14, 2018

This is, I think, a variant of #24250

@andybons andybons added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Aug 15, 2018
@andybons andybons added this to the Unplanned milestone Aug 15, 2018
@andybons
Copy link
Member

@rsc @bcmills @ianlancetaylor

@bcmills
Copy link
Contributor

bcmills commented Aug 23, 2018

Yes, this is a dup of #24250.

@bcmills bcmills closed this as completed Aug 23, 2018
@golang golang locked and limited conversation to collaborators Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants