Following this answer I have created the following project structure:
.
├── bin
├── pkg
└── src
└── github.com
└── GITHUB_USERNAME
└── PROJECTNAME
├── lib
│ └── model.go
│ └── ... .go
├── LICENSE
├── README.md
└── PROJECTNAME.go
PROJECTNAME.go
has the packagemain
model.go
has the packagePROJECTNAME
In the PROJECTNAME.go
I am importing the follwing:
import(
'github.com/GITHUB_USERNAME/PROJECTNAME/lib/model'
)
but when I run go build
I get the follwing error:
cannot find package "github.com/GITHUB_USERNAME/PROJECTNAME/lib/model" in any of:
/usr/lib/go/src/pkg/github.com/GITHUB_USERNAME/PROJECTNAME/lib/model (from $GOROOT)
/home/USERNAME/go/src/github.com/GITHUB_USERNAME/PROJECTNAME/lib/model (from $GOPATH)
How must the packages names be to import correctly? Are there any other strategies?