Go Summary of common commands

// Run filename.go // install it locally // It compiles the source code to get the executable file. Then move the executable file to the bin directory of GOPATH // not commonly used go install // Compile the go program in the current directory go build // compile the go program of the specified module, The module must compile the Linux executable SET under Windows in go build helloWorld // with the executable name specified in the SRC directory under go working directory go -o filename build // cross-platform compilation // CGO_ENABLED=0 // Disable CGO SET GOOS= Linux // Target platform is Linux SET GOARCH= AMd64 // target processor architecture is AMD64 go build //Mac platform compiles Linux executable files CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go buildCopy the code