17

I don't have much experience in go but I have been tasked to execute a go project :)

So i need to build the go project and then execute it

Below is the error when i build the go project. Seems to be some dependency(package and io/fs) is missing

transform/transform.go:13:2: package embed is not in GOROOT (/usr/local/Cellar/go/1.15.8/libexec/src/embed)
pkg/util/fs.go:4:2: package io/fs is not in GOROOT (/usr/local/Cellar/go/1.15.8/libexec/src/io/fs)

my go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/<XXXXX>/Library/Caches/go-build"
GOENV="/Users/<XXXXX>/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/<XXXXX>/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/<XXXXX>/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.8/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.8/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/<location to the project>/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5h/9qptf0sx3c12226jnqt75q8r0000gp/T/go-build648466970=/tmp/go-build -gno-record-gcc-switches -fno-common"

1 Answer 1

28

This package requires go v1.16, please upgrade your go version or use the appropriate docker builder.

3
  • 1
    thanks a lot...upgraded my go version and the build works
    – saurav
    Aug 12, 2021 at 6:34
  • 1
    Out of curiosity, what go version was listed in your go.mod file? (This may be a useful data point for golang.org/issue/46136.)
    – bcmills
    Aug 12, 2021 at 18:14
  • it was mentioned go 1.16....so does it mean that the go version of my local was considered instead of the mentioned one in the go.mod file ?
    – saurav
    Aug 13, 2021 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.