ubuntu@ubuntu:~/.work/src/github.hpe.com/hybridpoc/marketplace-terraform-tf-broker$ go run main.go
main.go:10:2: cannot find package "github.hpe.com/hybridpoc/marketplace-terraform-tf-broker/broker/github" in any of:
/home/ubuntu/go/src/github.hpe.com/hybridpoc/marketplace-terraform-tf-broker/broker/github (from $GOROOT)
/home/ubuntu/work/src/github.hpe.com/hybridpoc/marketplace-terraform-tf-broker/broker/github (from $GOPATH)
main.go:11:2: cannot find package "github.hpe.com/hybridpoc/marketplace-terraform-tf-broker/handlers" in any of:
/home/ubuntu/go/src/github.hpe.com/hybridpoc/marketplace-terraform-tf-broker/handlers (from $GOROOT)
/home/ubuntu/work/src/github.hpe.com/hybridpoc/marketplace-terraform-tf-broker/handlers (from $GOPATH)
This question seems to be about setting environment variables, not about the Go programming language.
As such, there are many answers. For example this ask.ubuntu question.
The easiest way for experimentation is prefixing your commands with NAME=value
, for example:
$ GOPATH=/some/path go <command>
Or, if you want to extend it to multiple shell commands within the same session, do:
$ export GOPATH=/some/path
$ go <command>
Once these work well, add the GOPATH
setting to your ~/.bashrc
file so that future sessions will find it without needing to export