Golang – 如何在工作区中定义多个项目

栏目: Go · 发布时间: 7年前

内容简介:Go中的GOPATH指向工作区.我可以在工作区中创建多个项目,并让GOPATH指向这些项目的位置列表吗?翻译自:https://stackoverflow.com/questions/18674462/golang-how-to-define-multiple-projects-in-workspace

Go中的GOPATH指向工作区.我可以在工作区中创建多个项目,并让GOPATH指向这些项目的位置列表吗?

是的,您可以在工作区中拥有多个项目.但是,您没有为此指定多个GOPATH.您只需在该GOPATH环境中创建两个项目.要编译,运行等,您只需指定要使用的入口点.

例如.

go run src/proj1/proj1.go
go run src/proj2/proj2.go

有关GOPATH和工作空间的更多信息,请参阅 the godoc on workspaces .

具体来说,“src包含组织成包的 Go 源文件(每个目录一个包),”.请注意,您不仅限于一个主程序包.

翻译自:https://stackoverflow.com/questions/18674462/golang-how-to-define-multiple-projects-in-workspace


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms in Python

Data Structures and Algorithms in Python

Michael T. Goodrich、Roberto Tamassia、Michael H. Goldwasser / John Wiley & Sons / 2013-7-5 / GBP 121.23

Based on the authors' market leading data structures books in Java and C++, this book offers a comprehensive, definitive introduction to data structures in Python by authoritative authors. Data Struct......一起来看看 《Data Structures and Algorithms in Python》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具