Whats a good best practice with Go workspaces?

后端 未结 10 1401
南方客
南方客 2021-01-30 10:46

I\'m just getting into learning Go, and reading through existing code to learn \"how others are doing it\". In doing so, the use of a go \"workspace\", especially as it relates

10条回答
  •  情话喂你
    2021-01-30 11:14

    At my company I created Virtualgo to make managing multiple GOPATHs super easy. A couple of advantages over handling it manually are:

    • Automatic switching to the correct GOPATH when you cd to a project.
    • It integrates well with vendoring tools
    • It also sets the new GOBIN in your path, so you can use the executables installed there.
    • It still has your original GOPATH as a backup. If a package is not found in the project specific workspace it will search the main GOPATH.

提交回复
热议问题