当前位置:网站首页>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
边栏推荐
- Screenshot of the operation steps of upload labs level 4-level 9
- Error handling when adding files to SVN:.... \conf\svnserve conf:12: Option expected
- Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
- Open PHP error prompt under Ubuntu 14.04
- Unity Render Streaming通过Js与Unity自定义通讯
- Kivy教程之 如何自动载入kv文件
- [技術發展-24]:現有物聯網通信技術特點
- MySQL functions and related cases and exercises
- [redis] cache warm-up, cache avalanche and cache breakdown
- 掌握Cypress命令行选项,是真正掌握Cypress的基础
猜你喜欢

AI scores 81 in high scores. Netizens: AI model can't avoid "internal examination"!
![[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered](/img/06/b71b505c7072d540955fda6da1dc1b.jpg)
[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered

全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场

KEIL5出现中文字体乱码的解决方法

RichView TRVStyle ListStyle 列表样式(项目符号编号)

Flutter dynamic | fair 2.5.0 new version features

使用tensorflow进行完整的DNN深度神经网络CNN训练完成图片识别案例

挡不住了,国产芯片再度突进,部分环节已进到4nm

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

Libuv Library - Design Overview (Chinese version)
随机推荐
Golang — template
[技術發展-24]:現有物聯網通信技術特點
Depth and breadth first traversal of tree (regardless of binary tree)
Unity embeddedbrowser browser plug-in event communication
Can newly graduated European college students get an offer from a major Internet company in the United States?
Resource Cost Optimization Practice of R & D team
Flutter dynamic | fair 2.5.0 new version features
使用Tensorflow进行完整的深度神经网络CNN训练完成图片识别案例2
8皇后问题
Kivy tutorial how to load kV file design interface by string (tutorial includes source code)
IBEM mathematical formula detection data set
顺序表(C语言实现)
Introduction to the implementation principle of rxjs observable filter operator
KEIL5出现中文字体乱码的解决方法
Mycms we media mall v3.4.1 release, user manual update
Universal dividend source code, supports the dividend of any B on the BSC
Anan's doubts
Error running 'application' in idea running: the solution of command line is too long
mysql中的字段问题
太阳底下无新事,元宇宙能否更上层楼?