This is a creation in Article, where the information may have evolved or changed.
Starting today, learn the go language and lay the groundwork for the future of BAT's advanced path.
First, Go introduction
Go is an open-source programming language that makes it easy to build software that is simple, reliable, and efficient.
Go Language Features:
Simple, fast, secure, parallel, fun, open source, memory management, v array security, compile quickly.
Go uses:
The Go language is designed as a system programming language for a giant central server that is powered by a WEB server that stores clusters or similar applications. In the field of high-performance distributed systems, the Go language is undoubtedly more efficient than most other languages. It provides a huge amount of parallel support, which is great for the development of the game server.
Second, environmental installation
The download address for the installation package is: https://golang.org/dl/.
1. Unix/linux/mac OS X, and FreeBSD installation
The following describes the use of the source installation method under Unix/linux/mac OS X, and FreeBSD systems:
1, download the source package: go1.4.linux-amd64.tar.gz.
2. Extract the downloaded source package to the/usr/local directory.
tar -C /usr/local -xzf go1.4.linux-amd64.tar.gz
3. /usr/local/go/bin
Add the directory to the PATH environment variable:
export PATH=$PATH:/usr/local/go/bin
Note : MAC
under the system you can use the .pkg
end of the installation package directly double-click to complete the installation, the installation directory /usr/local/go/
under.
2. Test run
I installed under the Mac, so, download it just double-click the installation, and then add the installation directory to the PATH
environment variable, you can go run
run the file with the command.
Create a project directory go, and then create a file under that directory test.go
.
package mainimport "fmt"func main(){ fmt.Println("Hello, World")}
Switch to go directory, and then run the test file, if you see a normal output, it means that the environment is set OK.