go - Build and install golang project with some internal packages -
go - Build and install golang project with some internal packages -
i have next golang project structure:
- go-projects - src - github.com - user - my-project - pack - pack.go - main.go my gopath is:
export gopath=/home/user/go-projects
i'm trying phone call functions pack bundle in main.go file , trying build project with:
cd my-project go build && go-install
there no output, , there no bin directory anywhere. did wrong?
upd problem solved. accidently missunderstood file content of main.go , pack.go. there problem.
how build correctly program. when i'm trying execute go build in /home/user/go-projects/src/github.com/user/my-project i'm getting next erros:
main.go:4:8: cannot find bundle "github.com/user/pack" in of: /home/user/downloads/go/src/pkg/github.com/user/pack (from $goroot) /home/user/go-projects/src/github.com/user/pack (from $gopath) thank you
while may convenient allow tools infer bundle current working directory, doesn't work much more simple main package. used referencing packages total import path, , you'll save other problems downwards line.
go install github.com/user/pack go
Comments
Post a Comment