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

Go 的包管理问题

  •  
  •   iamundefined ·
    fatedier · Apr 25, 2018 · 2731 views
  •   You need to sign in to view this topic
    This topic created in 3023 days ago, the information mentioned may be changed or developed.

    1、包都来自 Github,如果有一个底层包哪天没了,上面的不都编译不了吗。 2、有的包的路径来自第三方网站,网站能访问但是开启代理就 500,可是不开启代理,别的依赖就装不了。

    15 replies    2018-04-26 08:59:20 +08:00
    locktionc
        1
    locktionc  
       Apr 25, 2018
    你可以自己创建一个 vendor 文件夹,依赖的包都放在这个里面。这样就万无一失了。
    locktionc
        2
    locktionc  
       Apr 25, 2018
    LazyZhu
        3
    LazyZhu  
       Apr 25, 2018
    @locktionc
    错了, 应该用这个官版的 https://github.com/golang/dep
    wangxiaoaer
        4
    wangxiaoaer  
       Apr 25, 2018
    @LazyZhu #3 dep 还行,就是首次 init 的时候慢的让你怀疑人生。
    binjoo
        5
    binjoo  
       Apr 25, 2018
    go 的包管理很是蛋疼。
    specita
        6
    specita  
       Apr 25, 2018
    这就是 go 包管理蛋疼的地方了啊
    Mithrandir
        7
    Mithrandir  
       Apr 25, 2018   ❤️ 1
    dep 已经要被抛弃了, 请静静等待 vgo
    sophos
        8
    sophos  
       Apr 25, 2018
    vgo 了解一下,等正式版
    LazyZhu
        9
    LazyZhu  
       Apr 25, 2018
    dep 还没捂热呢, 又来一个...
    vgo 不只是包管理那么简单啊...
    myu7815
        10
    myu7815  
       Apr 25, 2018
    被 go 的包管理折腾不轻,目前组里用的都是 glide。虽然每次 update 很慢,但好像是比较好的选择了。墙外的包基本上在 github 上都有镜像,glide 配置文件指定下 git 仓库地址就行了。

    以前看了一眼 dep,没找到怎么管理 gitlab 上的包的方法,gitlab 上的包是需要指定 git 仓库地址的,dep 好像不支持。
    iamundefined
        11
    iamundefined  
    OP
       Apr 25, 2018
    @locktionc 目前用的 dep 看在官方推 只是 dep 安装大部分不也是去 github 上下载
    iamundefined
        12
    iamundefined  
    OP
       Apr 25, 2018
    @wangxiaoaer 走代理速度还好,就是有的包不再 github 上,第三方网站上的走代理直接 500,dep 就报错,直接 init 失败
    比如这个 http://www.stathat.com/c/consistent
    locktionc
        13
    locktionc  
       Apr 25, 2018
    @iamundefined 和 Glide 比哪个好
    janxin
        14
    janxin  
       Apr 26, 2018 via iPad
    @myu7815 支持
    orderc
        15
    orderc  
       Apr 26, 2018
    @myu7815 #10 简单配置一下 git, dep 就支持从 gitlab 拉取代码了
    https://edenmal.moe/2017/06/02/Golang-go-get-from-Gitlab/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   951 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 21:37 · PVG 05:37 · LAX 14:37 · JFK 17:37
    ♥ Do have faith in what you're doing.