OK GO

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 compiled
  • go 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 code
  • go get: Dynamically obtain remote code packages
  • go 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/bin
  • go test: Automatically read the *_test.go file, generate and run the executable file for testing
  • go env: View the environment variables of the current GO
  • go list: List all currently installed packages
  • go run: compile and run a Go program

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325804200&siteId=291194637
Go