Home > Article > Backend Development > Do you know why using GOPATH is no longer recommended and how to use Go Modules
The following tutorial column will introduce to you why it is no longer recommended to use GOPATH and how to use Go Modules. I hope it will be helpful to friends in need! Reason: With Go Modules
#go mod init
Command initialization, such as:mkdir myProject/ cd myProject go mod init github.com/myGithubName/myProject
GOPATH project migration, such as:
mv ~/go/src/github.com/myGithubName/myProject ~/anywhere_else/ cd ~/anywhere_else/myProject go mod init github.com/myGithubName/myProject
go language
column!
The above is the detailed content of Do you know why using GOPATH is no longer recommended and how to use Go Modules. For more information, please follow other related articles on the PHP Chinese website!