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

GOCACHE=off causes modules to exit the tests #26809

Closed
paroxp opened this issue Aug 4, 2018 · 1 comment
Closed

GOCACHE=off causes modules to exit the tests #26809

paroxp opened this issue Aug 4, 2018 · 1 comment

Comments

@paroxp
Copy link

paroxp commented Aug 4, 2018

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

→ go version
go version go1.11beta3 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

→ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/paroxp/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/paroxp/golang"
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="/mnt/d/Projects/qwerty/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-build625123659=/tmp/go-build -gno-record-gcc-switches"

What did you do?

To be honest, not much. In attempt to turn off cache and running the tests Go throws an error.

  • No longer using GOPATH, but custom project location
  • Using the beta3 version
  • Using go mod

What did you expect to see?

Running tests. This is the regression from the previous version and may break people's setup (CI for instance).

What did you see instead?

→ GOCACHE=off go test ./...
go: cannot use modules with build cache disabled
@paroxp paroxp changed the title GOCACHE=off causes modules to exit a process GOCACHE=off causes modules to exit the tests Aug 4, 2018
@paroxp
Copy link
Author

paroxp commented Aug 4, 2018

The GOCACHE env variable will be phased out out in 1.12, and cannot be used with go modules enabled in 1.11. https://tip.golang.org/doc/go1.11#gocache
I presume you want to disable the test caching, in which case you can use go test -count=1 ...

- mikef from slack

@paroxp paroxp closed this as completed Aug 4, 2018
@golang golang locked and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants