代码之家  ›  专栏  ›  技术社区  ›  rellocs wood

如何从源代码手动安装go包

  •  0
  • rellocs wood  · 技术社区  · 6 年前

    我生活在中国,无法通过命令下载和安装go-package(如果我使用VPN网络):

     go get -u <repo_url>
    

    但我可以进入 回购URL 并下载其源代码。 所以我的问题是我能把天灾代码放在下面吗? SRC 文件夹并运行命令?:

    go install 
    

    如果是,这两条路有什么不同?

    1 回复  |  直到 6 年前
        1
  •  2
  •   kkpoon    6 年前

    repo_url https://github.com/hello/example

    go get

    $ cd $GOPATH
    $ mkdir -p src/github.com/hello
    $ cd src/github.com/hello
    $ git clone https://github.com/hello/example.git
    $ cd example
    $ go install
    

    $GOPATH/bin

    推荐文章