jdi has the right information concerning the use of GOPATH
. I would add that if you intend to have a binary as well you might want to add one additional level to the directories.
~/projects/src/
myproj/
mypack/
lib.go
lib_test.go
...
myapp/
main.go
running go build myproj/mypack
will build the mypack
package along with it's dependencies
running go build myproj/myapp
will build the myapp
binary along with it's dependencies which probably includes the mypack
library.