当前位置:网站首页>Go 1.16.4: manage third-party libraries with Mod
Go 1.16.4: manage third-party libraries with Mod
2022-07-03 13:48:00 【Lao Liu, you are so awesome】
One , View the available versions of a third-party library :
Here to gin For example :
[email protected]:~$ go list -m -versions github.com/gin-gonic/gin
github.com/gin-gonic/gin v1.1.1 v1.1.2 v1.1.3 v1.1.4 v1.3.0 v1.4.0
v1.5.0 v1.6.0 v1.6.1 v1.6.2 v1.6.3 v1.7.0 v1.7.1 v1.7.2 explain : Liu Hongdi's go The forest is a focus golang The blog of ,
Address :https://blog.csdn.net/weixin_43881017
explain : author : Liu Hongdi mailbox : [email protected]
Two , View the locally downloaded version :
[email protected]:~$ ls /home/liuhongdi/go/pkg/mod/github.com/gin-gonic
[email protected] [email protected]explain :/home/liuhongdi/go/pkg/mod yes GOMODCACHE The path of ,
Used to save third-party libraries
example :
[email protected]:~$ go env
...
GOMODCACHE="/home/liuhongdi/go/pkg/mod"3、 ... and , Download the specified version of the third-party library :
explain : stay @ Later specified version
[email protected]:~$ go get github.com/gin-gonic/[email protected]
go: downloading github.com/gin-gonic/gin v1.7.1Check the effect after downloading :
[email protected]:~$ ls /home/liuhongdi/go/pkg/mod/github.com/gin-gonic
[email protected] [email protected] [email protected]Four , Download the latest version of the third-party library :
[email protected]:~$ go get -u github.com/gin-gonic/gin
…See the effect :
[email protected]:~$ ls /home/liuhongdi/go/pkg/mod/github.com/gin-gonic
[email protected] [email protected] [email protected] [email protected]5、 ... and , Use the specified version of the third-party library in the project :
explain : It needs to be operated under the project directory
Check out the original version :
[email protected]:/data/liuhongdi/digv01$ more go.mod
module github.com/liuhongdi/digv01
go 1.16
require (
github.com/gin-gonic/gin v1.6.3
github.com/jinzhu/gorm v1.9.16
)Specify the use of v1.7.2 edition
[email protected]:/data/liuhongdi/digv01$ go get github.com/gin-gonic/[email protected]
[email protected]:/data/liuhongdi/digv01$ more go.mod
module github.com/liuhongdi/digv01
go 1.16
require (
github.com/gin-gonic/gin v1.7.2
github.com/jinzhu/gorm v1.9.16
)6、 ... and , View all dependencies of the third-party library of the specified project :
explain : It needs to be operated under the project directory
[email protected]:/data/liuhongdi/digv01$ go list -m all
github.com/liuhongdi/digv01
github.com/PuerkitoBio/goquery v1.5.1
github.com/andybalholm/cascadia v1.1.0
...7、 ... and , Manually remove a dependency from the project :
see go.mod
[email protected]:/data/liuhongdi/digv01$ more go.mod
module github.com/liuhongdi/digv01
go 1.16
require (
github.com/gin-gonic/gin v1.7.0
github.com/jinzhu/gorm v1.9.16
)Delete
# -droprequire: Specify the dependencies to remove
[email protected]:/data/liuhongdi/digv01$ go mod edit -droprequire=github.com/gin-gonic/ginSee the effect
[email protected]:/data/liuhongdi/digv01$ more go.mod
module github.com/liuhongdi/digv01
go 1.16
require github.com/jinzhu/gorm v1.9.168、 ... and , Add a dependency manually in the project :
explain : Version required
# -require: Specify the dependencies to add
[email protected]:/data/liuhongdi/digv01$ go mod edit -require=github.com/gin-gonic/[email protected]See the effect
[email protected]:/data/liuhongdi/digv01$ more go.mod
module github.com/liuhongdi/digv01
go 1.16
require (
github.com/gin-gonic/gin v1.7.1
github.com/jinzhu/gorm v1.9.16
)explain : And execute under the project directory go get The same command
Nine , see go Version of :
[email protected]:/data/go/mod3$ go version
go version go1.16.4 linux/amd64
边栏推荐
- Software testing is so hard to find, only outsourcing offers, should I go?
- PowerPoint 教程,如何在 PowerPoint 中將演示文稿另存為視頻?
- Mastering the cypress command line options is the basis for truly mastering cypress
- Kivy教程之 如何自动载入kv文件
- 常见的几种最优化方法Matlab原理和深度分析
- The latest BSC can pay dividends. Any B usdt Shib eth dividend destruction marketing can
- MapReduce实现矩阵乘法–实现代码
- ThreadPoolExecutor realizes multi-threaded concurrency and obtains the return value (elegant and concise way)
- 【556. 下一个更大元素 III】
- Windos creates Cordova prompt because running scripts is prohibited on this system
猜你喜欢

Tutoriel PowerPoint, comment enregistrer une présentation sous forme de vidéo dans Powerpoint?

Internet of things completion -- (stm32f407 connects to cloud platform detection data)

Comprehensively develop the main channel of digital economy and digital group, and actively promote the utonmos digital Tibet market

SQL Injection (AJAX/JSON/jQuery)
![[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay](/img/18/b06e2e5a2f76dc2da1c2374b8424b3.png)
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay

又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了

There is nothing new under the sun. Can the meta universe go higher?

This math book, which has been written by senior ml researchers for 7 years, is available in free electronic version

HALCON联合C#检测表面缺陷——HALCON例程autobahn

106. How to improve the readability of SAP ui5 application routing URL
随机推荐
[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
Father and basketball
[redis] cache warm-up, cache avalanche and cache breakdown
软件测试工作那么难找,只有外包offer,我该去么?
User and group command exercises
Anan's doubts
Unity EmbeddedBrowser浏览器插件事件通讯
MyCms 自媒体商城 v3.4.1 发布,使用手册更新
Error running 'application' in idea running: the solution of command line is too long
【电脑插入U盘或者内存卡显示无法格式化FAT32如何解决】
[机缘参悟-37]:人感官系统的结构决定了人类是以自我为中心
Kivy教程之 盒子布局 BoxLayout将子项排列在垂直或水平框中(教程含源码)
Comprehensive evaluation of double chain notes remnote: fast input, PDF reading, interval repetition / memory
Start signing up CCF C ³- [email protected] chianxin: Perspective of Russian Ukrainian cyber war - Security confrontation and sanctions g
SQL Injection (GET/Search)
Complete deep neural network CNN training with tensorflow to complete picture recognition case 2
Mycms we media mall v3.4.1 release, user manual update
JS convert pseudo array to array
编程内功之编程语言众多的原因
Unity Render Streaming通过Js与Unity自定义通讯