4 ms·
Don't try to work around it, but embrace $GOPATH instead. As soon as you put your project inside $GOPATH/src (or ${GOPATH%%:*}/src if you want to be pedantic),
by _ak 12y ago
Don't try to work around it, but embrace $GOPATH instead. As soon as you put your project inside $GOPATH/src (or ${GOPATH%%:*}/src if you want to be pedantic), things work flawlessly, esp. all the tooling around Go that expects to work with $GOPATH.
In my company, we have the convention for our internal Go projects to be checked out below $GOPATH/src in a $company_name/$project_name hierarchy, and that's also what you'd use as import path.