I know local imports should be avoided, however special circumstances demand it in this case. It's a private repo, and the heroku buildpack fails in the go get ./...
phase when used with absolute urls, due to a missing private key on the server.
Now I get this error local import ".." in non-local package
.
All import paths were changed to the local version so what remains that qualifies a package as "non-local"? How do I fix this?
I fixed it. The issue was that the root package was in $GOPATH/src/<host>/<user>/<package>
. As soon as I moved the package to ~/Git/<package>
the errors were gone (thus, "made it local").
A local package import path is an absolute file system path or one beginning with ./ or ../. A non-local package import path is not a local package import path.
peterSo is right. Looking at the code where that error message gets generated it would happen if the package being loaded didn't start with / ./ or ../ but it imported one that did. In the case of your issue there are several things that could cause it.
I think perhaps you should just fix the missing private key issue on the server rather than trying to use a local path.
To properly debug I'd need to know what packages exactly that you were getting and what their transitive dependencies were.
One last thing why are you using go get for local path installation (ie. go get ./...
)? go install or go build are usually what you want in that case.