M
M
Madion2016-05-30 13:32:18
go
Madion, 2016-05-30 13:32:18

Golang - how to build a package (can't load package - error)?

I'm already going crazy. Can't build package.
go env outputs (all paths are correct):

GOROOT="/usr/local/go"
GOBIN="/usr/local/go/bin"
GOARCH="amd64"
GOCHAR="6"
GOOS="linux"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CGO_ENABLED="1"

echo $PATH outputs:
/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin

echo $GOPATH outputs:
/var/www/admin/tools/go
Folder structure: /var/www/admin/tools/go:
bin
src
src/websocket/websocket.go
The build command throws an error:
[email protected]:/var/www/admin/tools/go# go build websocket

can't load package: package websocket: import "websocket": cannot find package
Help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question