douao1854 2017-08-19 12:49
浏览 47
已采纳

无法建立开源项目

I'd like to contribute to an OSS project built with go, but I'm having hard time compiling it. It looks as if I'm missing something obvious.

I think the problem is related to how go is installed on my computer, and not to the project itself, thus I'm posting it here on StackOverflow, instead of project's "Issues" section.

Below is what I'm doing.


  1. I've installed go using homebrew:

    $ brew install go
    Updating Homebrew...
    ==> Auto-updated Homebrew!
    Updated 1 tap (homebrew/core).
    ==> Updated Formulae
    libebml

    ==> Downloading https://homebrew.bintray.com/bottles/go-1.8.3.sierra.bottle.tar.gz
    Already downloaded: /Users/gmile/Library/Caches/Homebrew/go-1.8.3.sierra.bottle.tar.gz
    ==> Pouring go-1.8.3.sierra.bottle.tar.gz
    ==> Caveats
    A valid GOPATH is required to use the go get command.
    If $GOPATH is not specified, $HOME/go will be used by default:
    https://golang.org/doc/code.html#GOPATH

    You may wish to add the GOROOT-based install location to your PATH:
    export PATH=$PATH:/usr/local/opt/go/libexec/bin
    ==> Summary

  • 写回答

2条回答 默认 最新

  • doutan3463 2017-08-19 13:26
    关注

    Your path when cloning the source must be on the golang PATH like : /home/gujarat/golang/src/github.com/lucapette/fakedata

    as you can see my Path to golang path is : /home/gujarat/golang/. You can also print your golang path in your terminal by entering : $GOPATH.

    And the git clone should be in the following the exact as above path : src/github.com/lucapette/.

    cd $GOPATH/src/github.com/
    mkdir lucaptte
    cd lucapette
    git clone https://github.com/lucapette/fakedata.git
    

    When you are running the make command which trigger go build this command will look the $GOPATH and your $GOROOT folder.

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

报告相同问题?

悬赏问题

  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?