first step
Create a new folder and name it mygin1. Enter the folder, enter cmd in the file path bar to enter the command line window
second step
Enter in the command line go mod init 文件夹名
, (the premise is that the basic operating environment configuration of golang is complete, the first step is to initialize the official go project management file go.mod, without which the gin framework cannot be installed)
Notice: Although I can’t tell the reason, you can set it
go env -w GO111MODULE=on
third step
After you have go.mod, you can directly enter the installation command of the gin framework.
go get -u github.com/gin-gonic/gin
but pay attention: Due to the limited access to GitHub, you can set the proxy in the cmd window
go env -w GOPROXY=https://goproxy.io,direct
the fourth step
Close the command line window and open the folder with the Goland tool. The main.go file can be created for testing.