The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
iamverylovely

请问 go build 出现私有仓库下载不了怎么解决?

  •  
  •   iamverylovely · Aug 11, 2020 · 2294 views
    This topic created in 2132 days ago, the information mentioned may be changed or developed.

    私有仓库的代码在本地有,但是没有这个仓库的权限,不是我自己的仓库,代码最初是开源的,之后设为私有了。

    之前克隆了一份到本地,不知道怎么引用,纯小白 GoGoGo 。

    go build
    
    build my_project: cannot find module for path github.com/example/my_project/xxx/xxx/xxx
    
    
    9 replies    2020-08-11 17:57:07 +08:00
    maichael
        1
    maichael  
       Aug 11, 2020
    你都没权限还能怎么办。
    Vegetable
        2
    Vegetable  
       Aug 11, 2020
    把仓库上传到自己的 github 上,引用地址改一下
    virusdefender
        3
    virusdefender  
       Aug 11, 2020
    git submodule
    robinch
        4
    robinch  
       Aug 11, 2020
    读读代码
    AmrtaShiva
        6
    AmrtaShiva  
       Aug 11, 2020 via iPhone
    编辑 go.mod
    require github.com/example/my_project/xxx/xxx/xxx v0.0.0
    replace github.com/example/my_project/xxx/xxx/xxx =>/你 clone 的本地地址
    Leigg
        7
    Leigg  
       Aug 11, 2020 via Android
    记得有个 GOPRIVATE 变量解决
    reus
        8
    reus  
       Aug 11, 2020
    放到本地,然后 go.mod 里写

    github.com/example/my_project/ => ./my_project
    iamverylovely
        9
    iamverylovely  
    OP
       Aug 11, 2020
    @AmrtaShiva
    @Jirajine
    @reus 解决了,问题原来是 GO 版本低了,设置了这些都不起作用,之前找到过这些方法,谢谢各位了。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2655 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 10:54 · PVG 18:54 · LAX 03:54 · JFK 06:54
    ♥ Do have faith in what you're doing.