douchongbang6011 2016-03-24 13:00
浏览 54
已采纳

转到-我是否为所有项目都有一个工作区,或者每个项目有一个工作区?

When using Go how are projects organized? I'm a bit confused on the workspaces part. I've had a read of the following: https://golang.org/doc/code.html#Workspaces ... and this part has thrown me off a little:

A typical workspace contains many source repositories containing many packages and commands. Most Go programmers keep all their Go source code and dependencies in a single workspace.

Does this mean that for each project I create it is a seperate workspace? For example if two projects use the same package, I would have two copies of that package on my computer.

Or, does it mean you have a main workspace and your projects share those packages?

Bit confused.

  • 写回答

3条回答 默认 最新

  • dongzouhe9734 2018-02-08 15:40
    关注

    I personally like to have a different GOPATH per project. If you are fine using a tool to automate the process you can use vg which will take care of managing different GOPATHs for your projects.

    The neat bit is that it integrates with most shells and auto-detect projects as you cd them.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分