当前位置:网站首页>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
边栏推荐
- The principle of human voice transformer
- Shell timing script, starting from 0, CSV format data is regularly imported into PostgreSQL database shell script example
- Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
- 106. How to improve the readability of SAP ui5 application routing URL
- Brief analysis of tensorboard visual processing cases
- 双向链表(我们只需要关注插入和删除函数)
- Leetcode-1175. Prime Arrangements
- Anan's doubts
- Spark实战1:单节点本地模式搭建Spark运行环境
- 顺序表(C语言实现)
猜你喜欢

Go language unit test 3: go language uses gocovey library to do unit test
[email protected] chianxin: Perspective of Russian Ukrainian cyber war - Security confrontation and sanctions g"/>Start signing up CCF C ³- [email protected] chianxin: Perspective of Russian Ukrainian cyber war - Security confrontation and sanctions g

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

Multi table query of MySQL - multi table relationship and related exercises

Halcon combined with C # to detect surface defects -- Halcon routine autobahn

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

When updating mysql, the condition is a query

常见的几种最优化方法Matlab原理和深度分析

Flutter dynamic | fair 2.5.0 new version features

Flutter dynamic | fair 2.5.0 new version features
随机推荐
Comprehensive evaluation of double chain notes remnote: fast input, PDF reading, interval repetition / memory
[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
Resolved (error in viewing data information in machine learning) attributeerror: target_ names
Software testing is so hard to find, only outsourcing offers, should I go?
【电脑插入U盘或者内存卡显示无法格式化FAT32如何解决】
Golang - command line tool Cobra
Mastering the cypress command line options is the basis for truly mastering cypress
静态链表(数组的下标代替指针)
Kivy教程之 盒子布局 BoxLayout将子项排列在垂直或水平框中(教程含源码)
Logback log sorting
[技术发展-24]:现有物联网通信技术特点
JS convert pseudo array to array
When updating mysql, the condition is a query
SVN添加文件时的错误处理:…\conf\svnserve.conf:12: Option expected
[technology development-24]: characteristics of existing IOT communication technology
3D视觉——2.人体姿态估计(Pose Estimation)入门——OpenPose含安装、编译、使用(单帧、实时视频)
Go language unit test 4: go language uses gomonkey to test functions or methods
Screenshot of the operation steps of upload labs level 4-level 9
JVM系列——概述,程序计数器day1-1
The reasons why there are so many programming languages in programming internal skills