V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
blackcurrant
V2EX  ›  Go 编程语言

如何在已有项目中添加 go 代码?

  •  
  •   blackcurrant · 2019-06-13 09:55:51 +08:00 · 2291 次点击
    这是一个创建于 1800 天前的主题,其中的信息可能已经有所发展或是发生改变。
    刚接触 golang。我知道 go 有个工作空间的感念,需要把所有的 go 源代码文件放在 $GOPATH/src 目录下。但我有个不是用 go 写的项目,现在想把其中一个服务用 go 写。项目目录在 $GOPATH 之外,如果我按照下面的方式组织代码,如何才能使用 go tool 进行编译呢?

    /myproject/
    ├── redis
    ├── python
    ├── gocode
    2 条回复    2019-06-13 10:12:31 +08:00
    3CH0
        1
    3CH0  
       2019-06-13 10:04:53 +08:00
    go mod
    zsc8917zsc
        2
    zsc8917zsc  
       2019-06-13 10:12:31 +08:00
    自己改下 GOPATH
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5452 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:36 · PVG 17:36 · LAX 02:36 · JFK 05:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.