当前位置:网站首页>Go modules daily use
Go modules daily use
2022-04-23 19:21:00 【Handsome that handsome】
1. initialization
go mod init
2. Go Proxy
Due to limited access to domestic and foreign networks , Usually we will cooperate Go Proxy Use , To prevent the use of go get It takes too long to get the source code package or cannot be downloaded :
go env -w GOPROXY=https://goproxy.cn
3.go.mod
Every time go get Will be modified at the same time go.mod and go.sum file .
These two files are the main basis for downloading dependent packages .go.mod Be similar to PHP Medium composer.json , and go.sum It is composer.lock.
Open view go.mod Source code :
go.mod
module github.com/summerblue/goblog
go 1.15
require (
github.com/gorilla/mux v1.7.4
github.com/julienschmidt/httprouter v1.3.0 // indirect
)
A few parameters :
module —— our goblog stay Go Module It's one of them Module ;
go —— Version requirements are specified , The minimum 1.15
require —— It is the dependency of the project
4. Empty Go Modules cache
go clean -modcache
5. Download dependency
go mod download
6. all Go Modules command
command effect
go mod init Generate go.mod file
go mod download download go.mod All dependencies specified in the file
go mod tidy Sort out existing dependencies
go mod graph Look at the existing dependency structure
go mod edit edit go.mod file
go mod vendor All dependencies of the export project depend on vendor Catalog
go mod verify Verify that a module has been tampered with
go mod why See why you need to rely on a module
版权声明
本文为[Handsome that handsome]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210557450769.html
边栏推荐
- An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
- [advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
- SQL of contention for system time plus time in ocrale database
- openlayers 5.0 当地图容器大小改变时,重新加载地图
- Strange problems in FrameLayout view hierarchy
- Executor、ExecutorService、Executors、ThreadPoolExecutor、Future、Runnable、Callable
- 腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练
- 命令-sudo
- An example of using JNI to directly access surface data
- An 8266 crash
猜你喜欢
8266 obtain 18b20 temperature
[advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
优先使用组合而不使用继承
[报告] Microsoft :Application of deep learning methods in speech enhancement
Wechat video extraction and receiving file path
浅谈c语言指针的强制转换
2022.04.23 (lc_763_divided into letter interval)
Openharmony open source developer growth plan, looking for new open source forces that change the world!
Build intelligent garbage classification applet based on Zero
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
随机推荐
@Analysis of conditional on Web Application
static类变量快速入门
浅谈c语言指针的强制转换
机器学习目录
NiO related Basics
FTP, SSH Remote Access and control
Steps to build a deep learning environment GPU
[report] Microsoft: application of deep learning methods in speech enhancement
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
openlayers 5.0 热力图
Application of DCT transform
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Transaction processing of SQL Server database
Data analysis learning directory
SSDB基础2
网络协议之:sctp流控制传输协议
Thoughts on the optimization of examination papers in the examination system
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
Some records used by VS2010
Some speculation about the decline of adults' language learning ability