当前位置:网站首页>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 . ︎
边栏推荐
- 【读书会第13期】+FFmpeg视频采集功能
- IAAs infrastructure cloud cloud network
- mindoc制作思维导图
- 第三章、数据类型和变量
- 【小5聊】公众号排查<该公众号提供的服务出现故障,请稍后>
- 为什么 4EVERLAND 是 Web 3.0 的最佳云计算平台
- 【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part4):结合问题分类的问题解析与检索语句生成
- Chapter III data types and variables
- Data analysis and privacy security become the key factors for the success or failure of Web3.0. How do enterprises layout?
- Rosen's QT journey 99 QML table control tableview
猜你喜欢

Virtual memory management

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

3D 语义分割——Scribble-Supervised LiDAR Semantic Segmentation

Budget report ppt

IAAs infrastructure cloud cloud network

How to deploy applications on IPFs using 4everland cli

Step by step introduction of sqlsugar based development framework (13) -- package the upload component based on elementplus, which is convenient for the project

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

柏睿数据加入阿里云PolarDB开源数据库社区

简述redis集群的实现原理
随机推荐
152. 乘积最大子数组
[knowledge atlas] practice -- Practice of question answering system based on medical knowledge atlas (Part3): rule-based problem classification
异常处理机制专题1
[redis] redis installation
Chapter V: process control
Chapter 4: operators
【目标检测】YOLOv5跑通VisDrone数据集
Rebudget: balance efficiency and fairness in market-based multi-core resource allocation by reallocating the budget at run time
How to deploy applications on IPFs using 4everland cli
[OBS] Reprint: what about the serious delay of OBS live broadcast and Caton?
Attachment handling of SAP Fiori
Rebudget汇报PPT
【数学建模绘图系列教程】二、折线图的绘制与优化
Enterprise live broadcast: witness focused products, praise and embrace ecology
SAP Fiori 的附件处理(Attachment handling)
C # introductory basic tutorial
ReBudget:通过运行时重新分配预算的方法,在基于市场的多核资源分配中权衡效率与公平性
MySQL linked table query, common functions, aggregate functions
MySQL之联表查询、常用函数、聚合函数
Replicate swin on Huawei ascend910_ transformer