I want to install json2csv using go get github.com/jehiah/json2csv
but I receive this error:
package github.com/jehiah/json2csv: cannot download
I had to run an application as root (to open a webserver on port 80), this produced the error for me, because the sudo user has a different environment than the normal user, hence GOPATH was not set.
If someone else is having this problem, add -E
to the command, this will preserve the user environment.
sudo -E go run main.go
For more infos see discussion here: Google Groups – GOPATH Problem