dep ensure报错unable to update checked out version: fatal: reference is not a tree:

dep ensure报如下错误:

(1) ✗ unable to update checked out version: fatal: reference is not a tree: 2b758aa73013d2b1f11077aeca87ea042a1438bf
(1) : command failed: [git checkout 2b758aa73013d2b1f11077aeca87ea042a1438bf]: exit status 128
(1) ← no more versions of github.com/bradfitz/slice to try; begin backtrack

但是查看过 github.com/bradfitz/slice ,2b758aa73013d2b1f11077aeca87ea042a1438bf命名是master上的最新一条commit。几经尝试和搜索,找到了如下可行的解决方法:

删除 $GOPATH/pkg/dep/sources

参考:https://github.com/golang/dep/issues/699

你可能感兴趣的:(dep ensure报错unable to update checked out version: fatal: reference is not a tree:)