I am trying to use go get
which means I have to set the go path. I have tried this through a ton of ways, so please do not mark this as a duplicate unless that solution works. I have tried almost every solution on SO I could find.
My chef code
package 'golang-go'
directory '/work-disk/go' do
owner consul_user
group consul_user
mode '0755'
action :create
end
bash 'go' do
user consul_user
code <<-EOH
export GOPATH=/work-disk/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
EOH
action :run
end
I had export GOPATH=$HOME/go
before but that seemed to fail so I created a directory to test with and explicitly said the directory but still no luck
Error message
cannot download, $GOPATH not set. For more details see: go help gopath