Recently, we've been working on Docker and Kubernetes, both in the go language, in order to get a deeper understanding of Docker and kubernetes, and to learn about the go language.
In order to learn in detail, a directory is listed here, will be constantly updated
- Golang Study notes-Environment Building Guide (this article)
- Golang Study notes-ide selection and Installation Guide
Continue to update, not to be continued ...
The Go language supports the following systems:
- Linux
- Freebsd
- Mac OS X (Darwin)
- Windows
Official website for https://golang.org/, unfortunately because GFW reason can't open. But we can access it through this website https://golang.google.cn/.
Download the installation package
First go to the download page
Download page
I am using the Windows operating system, so I downloaded the Go1.11.windows-amd64.msi
Install the Go Language development environment
Directly double-click the MSI file to install
Step 1step 2step 3step 4step 5step 6
The installer will automatically help us add environment variables
Environment variables
Test environment
Let's look at the console and enter "Go version" to see the version of the Go language.
Version
International practice, we write a Hello World program test, create a new file, the command is "Helloworld.go", write the following content:
package mainimport "fmt"func main() { fmt.Println("Hello, World!")}
Then run the program in the console using the following
go run HelloWorld.go
Hello World
Can see the correct output "Hello, world!", prove that the environment is installed successfully, enjoy!