Closed
Description
What version of Go are you using (go version
)?
go version go1.13.1 windows/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 set GO111MODULE= set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\rillig\AppData\Local\go-build set GOENV=C:\Users\rillig\AppData\Roaming\go\env set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\rillig\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=c:\go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=c:\go\pkg\tool\windows_amd64 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\rillig\Program Files\cygwin\tmp\go-build091584506=/tmp/go-build -gno-record-gcc-switches go: failed to remove work dir: GetFileInformationByHandle C:\Users\rillig\Program Files\cygwin\tmp\go-build091584506\NUL: Unzulässige Funktion.
The last line of the above output looks interesting in itself.
What did you do?
cd "$GOPATH/src"
go get github.com/rillig/pkglint
mv github.com/rillig/pkglint to netbsd.org/pkglint
cd netbsd.org/pkglint
go generate ./... && time go test ./...
# takes 20 seconds to run the test
# then, takes 50 seconds to cache the test results
go generate ./... && time go test -test.count 1 ./...
# takes 20 seconds
What did you expect to see?
Caching the test results needs less than a second.
What did you see instead?
Caching the test results takes much longer than running the test.
It doesn't matter whether I run the tests from within cmd.exe
or Cygwin.