Golang Study notes-Environment Building guide

Source: Internet
Author: User

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

  1. Golang Study notes-Environment Building Guide (this article)
  2. 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.