go.mod automatically manages packages

Manual go get is inefficient, and it can be managed automatically through mod to improve development efficiency

Steps:

1. Open cmd

2. set GO111MODULE=on

3.cd /d project directory

4. After go mod init demo.go, execute go mod tidy according to the prompt   

5.go run demo.go

Note: Step 4 can be performed only once 

Guess you like

Origin blog.csdn.net/glc22/article/details/131163850