2021年5月6日星期四

cannot find package "github.com/jackc/pgx/v4" in any of:

I am getting below error while running go script

bash-5.1# go run lab-processor/src/main.go -inputTEXTFile=lab-processor/src/list_file.lst -TableName=public.p_labs_data  lab-processor/src/main.go:18:2: cannot find package "github.com/jackc/pgx/v4" in any of:          /usr/local/go/src/github.com/jackc/pgx/v4 (from $GOROOT)          /opt/go/src/github.com/jackc/pgx/v4 (from $GOPATH)  

I am tried go get github.com/jackc/pgx/v4 and getting same error.

bash-5.1# go get github.com/jackc/pgx/v4  cannot find package "github.com/jackc/pgx/v4" in any of:          /usr/local/go/src/github.com/jackc/pgx/v4 (from $GOROOT)          /opt/go/src/github.com/jackc/pgx/v4 (from $GOPATH)  

Here is my go env look like

bash-5.1# go env  GO111MODULE=""  GOARCH="amd64"  GOBIN=""  GOCACHE="/root/.cache/go-build"  GOENV="/root/.config/go/env"  GOEXE=""  GOFLAGS=""  GOHOSTARCH="amd64"  GOHOSTOS="linux"  GOINSECURE=""  GOMODCACHE="/opt/go/pkg/mod"  GONOPROXY="gitlab.com/TARGETPharmaSolutions/*"  GONOSUMDB="gitlab.com/TARGETPharmaSolutions/*"  GOOS="linux"  GOPATH="/opt/go/"  GOPRIVATE="gitlab.com/TARGETPharmaSolutions/*"  GOPROXY="https://proxy.golang.org,direct"  GOROOT="/usr/local/go"  GOSUMDB="sum.golang.org"  GOTMPDIR=""  GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"  GCCGO="gccgo"  AR="ar"  CC="gcc"  CXX="g++"  CGO_ENABLED="1"  GOMOD=""  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-build004261076=/tmp/go-build -gno-record-gcc-switches"  

Also I tried export GO111MODULE=off and export GO111MODULE=on but it did not fix the issue.

https://stackoverflow.com/questions/67428502/cannot-find-package-github-com-jackc-pgx-v4-in-any-of May 07, 2021 at 11:05AM

没有评论:

发表评论