dep - Solving failure: No versions/No more versions of xxx

前言

如果你正在使用Golangdep工具,我相信你可能会遇到这个问题

dep 版本

$ dep version
dep:
 version     : devel
 build date  : 
 git hash    : 
 go version  : go1.10
 go compiler : gc
 platform    : linux/amd64

当前Latest releasev0.4.1

问题

使用dep包管理工具时,无论执行dep init -v或是dep ensure

总是报版本错误no more versionsno versions)的问题

$ dep ensure
Solving failure: No versions of xxxx met constraints:
    master: unable to update checked out version: fatal: reference is not a tree: 2c5e7ac708aaa719366570dd82bda44541ca2a63
: command Failed: [git checkout 2c5e7ac708aaa719366570dd82bda44541ca2a63]: exit status 128

原因

算是一个bug,是由于缓存的错误没有得到正确的更新

解决方

rm -rf $GOPATH/pkg/dep/sources

然后再重新执行dep ensure或是dep init -v就可以了

你又遇到过什么奇奇怪怪的问题呢,交流一下 :=)

相关文章

什么是Go的接口? 接口可以说是一种类型,可以粗略的理解为他...
1、Golang指针 在介绍Golang指针隐式间接引用前,先简单说下...
1、概述 1.1 Protocol buffers定义 Protocol buffe...
判断文件是否存在,需要用到"os"包中的两个函数: os.Stat(...
1、编译环境 OS :Loongnix-Server Linux release 8.3 CPU指...
1、概述 Golang是一种强类型语言,虽然在代码中经常看到i:=1...