Go Learning Tour - Environment Installation

GOROOT GOPATH download package address proxy settings simple use of go mod
  • 1. goroot is the installation path of go.
  • 2. gopath is the working directory of the go package. When using go mod for initialization, pkg bin will be generated in the two directories. The compiled class library bin in pkg contains the compiled executable program.
  • 3. go install is used to compile the GO language project code, and the compilation results are placed in the GOPATH/pkg GOPATH/bin directory respectively.
  • 4. Download a dependency package such as: go get github.com/xxx/xxx .
  • 5. Set up the proxy .
  • 6. Go Modules syntax go mod init [module name] has been introduced since version 1.11 of GO. When using GoLand IDE for project development, it should be noted that it is recommended that the project directory should not be the same as GOPATH, and the go mod is initialized At the same time, try to initialize the project name like go mod init. After initialization, you need to check GoLand , and then download the package .
{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324127922&siteId=291194637