当前位置:网站首页>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
边栏推荐
- Web Security
- The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
- Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
- 什么是消息队列
- 2021-2022-2 ACM集训队每周程序设计竞赛(8)题解
- SQL server requires to query the information of all employees with surname 'Wang'
- MySQL syntax collation (2)
- [play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
- [advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
- First experience of using fluent canvas
猜你喜欢

arcMap 发布切片服务

为何PostgreSQL即将超越SQL Server?
![[记录]TypeError: this.getOptions is not a function](/img/c9/0d92891b6beec3d6085bd3da516f00.png)
[记录]TypeError: this.getOptions is not a function

MySQL restores or rolls back data through binlog

Zero cost, zero foundation, build profitable film and television applet

MySQL syntax collation

Using Visual Studio code to develop Arduino

Pdf reference learning notes
![[报告] Microsoft :Application of deep learning methods in speech enhancement](/img/29/2d2addd826359fdb0920e06ebedd29.png)
[报告] Microsoft :Application of deep learning methods in speech enhancement

2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
随机推荐
Openlayers 5.0 reload the map when the map container size changes
ArcGIS JS API dojoconfig configuration
What is a message queue
Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
Steps to build a deep learning environment GPU
Openlayers 5.0 thermal diagram
Some ideas about time-consuming needs assessment
Keysight has chosen what equipment to buy for you
One stop service platform for high-level talents and development of comprehensive service platform system for talents
JVM的类加载过程
为何PostgreSQL即将超越SQL Server?
Common processing of point cloud dataset
Build intelligent garbage classification applet based on Zero
腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练
Openlayers draw rectangle
什么是消息队列
Tencent cloud GPU best practices - remote development training using jupyter pycharm
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
First experience of using fluent canvas
SSDB基础3