Whats a good best practice with Go workspaces?

后端 未结 10 1375
南方客
南方客 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:19

    I follow KISS - one GOPATH, two go paths:

    export GOPATH=$HOME/go:$HOME/development/go

    That way third party stuff goes in a central place (package install uses the first path entry by default), and I can flexibly move my projects elsewhere, at the second path entry.

提交回复
热议问题