Go Basic Learning

Source: Internet
Author: User
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.

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.