go-lang project folder structure convention -
i wanted confirm understanding of typical project folder structure in go project, follows go tool conventions.
if i'm writing package called my-package
, uses 3rd party external package - other-package
. based on conventions, directory structure correct ?
+bin +pkg +src | --- my-package.com/.. | --- external-package.com/..
the reason ask again after reading docs because unlike other language conventions, user , 3rd party code in same top level folder.
via irc #go-nuts
a user's machine have common $gopath/src
projects. $gopath/src
have multiple projects (user's, external packages etc.) there. user commit $gopath/src/mypackage
src repo.
if want have separate directories src, , 3rd party package source, prepend path $gopath
. go get
download 3rd party packages path. go-get
downloads 3rd packages first path finds in array of paths specified $gopath
.
Comments
Post a Comment