I'm just starting a project and want to use go modules. I've created a new repo with a small amount of functionality, but it refuses to build. I have tested go build
without modules and it works just fine. Error message:
C:\Users\gledr\Polyapp_Apps\gocode\src\gitlab.com\polyapp\go-wasm-mvc>go build go: extracting github.com/rs/cors v1.7.0 verifying github.com/rs/[email protected]: github.com/rs/[email protected]: initializing sumweb.Conn: checking tree#187855: downloaded inconsistent tile
I assume this error means I must re-download the relevant package, even though the package works without go modules!?
go build
works great if I delete go.mod but fails with go mod init
go build
go get gitlab.com/polyapp-open-source/go-wasm-mvc
the projectgo build -d github.com/blahblahblah
to get the files re-downloaded, but it apparently did absolutely nothingrm -rf $GOPATH/pkg
) will wipe out the memory of the latest observed tree size and hash". I believe this is the situation I am in, but when I removed the subpackage in the $GOPATH it still fails.$GOPATH/pkg/mod/cache/download/github.com/[package name]
but oddly although deleting the cache triggered a new 'go get', the re-downloaded file also had an inconsistent tile! From this experience I assume something is kooky with the go sum <-> $GOPATH/pkg verification.go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\gledr\AppData\Local\go-build
set GOENV=C:\Users\gledr\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\gledr\Polyapp_Apps\gocode
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=C:\Users\gledr\Polyapp_Apps\gocode\src\gitlab.com\polyapp\go-wasm-mvc\go.mod
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\gledr\AppData\Local\Temp\go-build525753618=/tmp/go-
build -gno-record-gcc-switches```
I ended up renaming the $GOPATH/pkg directory to $GOPATH/old_pkg - the equivalent of rm -rf $GOPATH/pkg
as suggested in the Go SUM proposal I linked in the question. Therefore all of the dependencies had to be re-downloaded, but it does work now.
Deleting the $GOPATH/pkg folder also resulted in another, much larger project of mine starting to work. It just took a few minutes to re-download all of the dependencies.