OK GO
Go language
Go is a new language, a concurrent, fast compiled language with garbage collection
- A large Go program can be compiled with a few seconds of events on a single computer
- Makes dependencies easier to analyze, avoiding the beginning of most C-style include files and libraries
- Statically typed languages, the type system has no hierarchy
- Garbage-collected language with basic support for concurrent execution and communication
Windows installation
- Select the msi installation package according to the computer, do not modify the default installation directory C:\GO\
- Enter Go in cmd to check whether you can see usage information; enter
cd %GOROOT%
it to see if you can enter the Go installation directory; if both are successful, the installation is successful.
Go command
go build
: Mainly used to compile code. During the compilation of the package, if necessary, the associated package is also compiledgo clean
: Used to remove the compiled files in the current source package and the associated source package. Generally, this command can be used to clear the compiled files, and then github submits the source code. These compiled files are related to the system during local testing, but are not necessary for source code management.go fmt
: used to format the written codego get
: Dynamically obtain remote code packagesgo install
: This command is internally divided into two steps: the first step generates the result file, and the second step moves the compiled result to $GOPATH/pkg or $GOPATH/bingo test
: Automatically read the *_test.go file, generate and run the executable file for testinggo env
: View the environment variables of the current GOgo list
: List all currently installed packagesgo run
: compile and run a Go program