当前位置:网站首页>How to install govendor and open a project
How to install govendor and open a project
2022-07-25 17:04:00 【Melody2050】
install govendor
Reference resources Go Dependencies via govendor
English
Use go 1.18, Execute... In any directory go install install govendor
go install github.com/kardianos/[email protected]
Place the item in $GOPATH/src1, List dependencies within the project
govendor list
You can see various dependencies in the project
...
l moby/volume
l moby/volume/drivers
l moby/volume/local
l moby/volume/mounts
l moby/volume/service
l moby/volume/service/opts
l moby/volume/testutils
m appengine
m appengine_internal
m appengine_internal/base
Then execute for each dependency that is not downloaded fetch that will do :
govendor fetch github.com/docker/docker/pkg/reexec
govendor fetch github.com/docker/docker/rootless
...
But use fetch It's a little inefficient , I haven't found any other efficient methods
Step on the pit
download govendor Failure
a connection attempt failed because the connected party did not properly respond after period of tim
GO A connection attempt failed because the connected party did not properly respond after a period…
If go install Download failed , Need modification go Our agent is domestic mirror
go env -w GOPROXY=https://goproxy.cn
govendor Wrong path
govendor error package not a go package or not in gopath
Your project is not placed in $GOPATH/src.
First, execute go env GOPATH View path , If it does not meet expectations , Just refer to windows11 How to modify environment variables , modify GOPATH System variables .
Delete govendor rely on
Use govendor fetch github.com/spf13/cobra To download depends on , And to $GOPATH/.cache Delete dependency under .
The specified branch cannot be pulled
Yes govendor fetch After the command , An error is as follows
D:\codes\src\moby>govendor fetch github.com/spf13/cobra
# cd D:\codes\.cache\govendor\github.com\spf13\cobra; git reset --hard origin/master
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree
.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: failed to sync to latest revision exit status 128
Failed to fetch package "github.com/spf13/cobra"
You can see ,govendor Trying to perform git reset --hard origin/master, But this branch cannot be found , Because the original warehouse did not have this branch

So after running , Successful implementation
govendor fetch github.com/spf13/[email protected]
Reference resources Go Vendoring Beginner Tutorial Description of , mention
Go to your project directory (it must be in the GOPATH src)You know , The project must be in GOPATH Of src Under the table of contents . ︎
边栏推荐
- win10如何删除微软拼音输入法
- 谁动了我的内存,揭秘 OOM 崩溃下降 90% 的秘密
- 第六章 继承
- 为什么 4EVERLAND 是 Web 3.0 的最佳云计算平台
- [knowledge atlas] practice -- Practice of question answering system based on medical knowledge atlas (Part3): rule-based problem classification
- Rebudget汇报PPT
- 多租户软件开发架构
- 博云容器云、DevOps平台斩获可信云“技术最佳实践奖”
- [book club issue 13] +ffmpeg open source project
- 【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part5-完结):信息检索与结果组装
猜你喜欢

简述redis集群的实现原理

ReBudget:通过运行时重新分配预算的方法,在基于市场的多核资源分配中权衡效率与公平性

数据分析与隐私安全成 Web3.0 成败关键因素,企业如何布局?

Briefly describe the implementation principle of redis cluster

在华为昇腾Ascend910上复现swin_transformer

用秩讨论线性方程组的解/三个平面的位置关系

Birui data joins Alibaba cloud polardb open source database community

Don't believe these "rumors" in the process of preparing for the exam!

动态规划题目记录

文字翻译软件-文字批量翻译转换器免费
随机推荐
从数字化到智能运维:有哪些价值,又有哪些挑战?
win10设备管理认不到GTX1080Ti 显示设备的解决办法
152. 乘积最大子数组
Outlook 教程,如何在 Outlook 中搜索日历项?
自定义mvc项目登录注册和树形菜单
Fudan University EMBA peer topic: always put the value of consumers in the most important position
Why 4everland is the best cloud computing platform for Web 3.0
【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part5-完结):信息检索与结果组装
异常处理机制专题1
Dynamic planning topic record
Text translation software - text batch translation converter free of charge
【MySQL篇】一文带你初识数据库
In the eyes of 100 users, there are 100 QQS
Technical difficulties and applications of large humanoid robots
[book club issue 13] +ffmpeg video capture function
Redis cluster deployment based on redis6.2.4
[target detection] yolov5 Runtong visdrone data set
数据分析与隐私安全成 Web3.0 成败关键因素,企业如何布局?
【读书会第13期】+FFmpeg视频采集功能
WPF 实现用户头像选择器