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: go run fails in GO111MODULE=auto context with valid go.mod #26710

Closed
myitcv opened this issue Jul 31, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@myitcv
Copy link
Member

commented Jul 31, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +b294fe9b0a Tue Jul 31 02:04:53 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

n/a: testing with tip

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPROXY=""
GORACE=""
GOROOT="/home/myitcv/gos"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/tmp.JPiFafV0vl/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-build373891732=/tmp/go-build -gno-record-gcc-switches"

What did you do?

export GO111MODULE=auto
cd $(mktemp -d)
go mod -init -module github.com/example/me
cat <<EOD > run.go
package main

import "fmt"

func main() {
        fmt.Println("Hello, world!")
}
EOD
go run run.go

What did you expect to see?

Hello, world!

What did you see instead?

build main: cannot find module for path main

/cc @rsc @bcmills

@myitcv myitcv added this to the Go1.11 milestone Jul 31, 2018

@myitcv

This comment has been minimized.

Copy link
Member Author

commented Aug 1, 2018

This was fixed by 6121987

@myitcv myitcv closed this Aug 1, 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.