dongxiao3694 2015-08-14 02:44
浏览 67
已采纳

使用Go GitHub存储库

I have Go installed, setup, and running hello world; I followed these directions. My workspace is organized as follows:

gocode/
    bin/
    pkg/
    src/
        github.com/
            my_username/
                hello/
                    hello.go
            anomalyzer/
                algorithms.go
                ...
                README.md

I would like to start using Go code from a forked GitHub repo, lytics/anomalyzer. How can I do this? I forked the repo and setup a local clone in github.com/anomalyzer/ as shown above. But from the github.com/anomalyzer/ dir I try go install and get the error message algorithms.go:5:2: cannot find package "github.com/drewlanenga/govector" in any of: ...(lists my GOPATH). It looks like I need to also clone the github.com/drewlanenga/govector, do I? Is there an automated way to get all the package dependencies?

  • 写回答

1条回答 默认 最新

  • doushouj966020 2015-08-14 02:46
    关注

    To fetch remote packages, run the go get command. Because the go get command automatically fetches dependencies and does not fetch a package that already have have, you can run

    go get github.com/lytics/anomalyzer 
    

    to get everything setup including the github.com/drewlanenga/govector package.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛