I have some Go code I want to test locally, then deploy to AWS. Everything is fine as long as I stay in a single directory/package.
However, I want my folder structure to be similar to this:
$GOPATH/src/project/application.go
$GOPATH/src/project/lib1/libcode.go
Locally, to use the code in "lib1" I need to use import "project/lib1"
But when deployed to AWS the "project" folder doesn't exist of course, so instead I have to use import "./lib1"
I can probably solve this problem by either having all code in a single folder/package, or by changing my $GOROOT every time I change working on a project, but both these workarounds feel dirty and awkward.
What's the correct way to tackle this? Thanks.