Go - import sql.a: not a package file
I am using go 1.3. When I try to connect to mysql in golang it works fine in linux console. When trying to do the same with go-ide 1.0, it throws itself like
"import / home / gold / software / go -ide / bundled / go-sdk / pkg / linux_amd64 / database / sql.a: not a package file"
Someone please suggest me how to solve this error.
>go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/local/go/bin:/home/gold/software/go-ide/bundled/go-sdk/bin"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
source to share
Have no idea about go-ide
, but it looks like this IDE comes with a bundled installation that's broken somehow.
database/sql
- standard package, the compiled file must be $GOROOT/pkg/linux_amd64/database/sql.a
.
As per your error message, your IDE somehow installs GOROOT
in
/home/gold/software/go-ide/bundled/go-sdk
.
So, you either fix the go installation along the way, or tell the IDE the real one GOROOT
.
source to share