It's very often I see .go files committed to pkg folder, like here https://github.com/kubernetes/apiserver what particular reason doing that vs using vendor folder for 3rdparty dependencies or commit your own code into src dir?
2条回答 默认 最新
- duanpie4763 2017-09-24 16:56关注
Please clarify further.
The
pkg
folder on that repo you linked is where they put the packages they wrote. Reason? well they need to put them somewhere, they chosepkg
.You use
vendor
folder when you don't want future changes to 3rd party packages you've used possibly make your program unstable, in that case you "vendor" those 3rd party packages. So you don't put your own packages invendor
folder for obvious reasons.Which
src
?$GOPATH/src
? you can do it! probably, I haven't test it. But you can only have one project in that case, and that's the project that you've placed there.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报