Go Programming Basics

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Go was officially released by Google in 2009.

Key Features of Go:

1. Type safety and memory security

2. Achieve high concurrency with intuitive and low-cost solutions

3. Efficient garbage collection mechanism

4. Fast compile (also solve the problem of too many header files in C language)

5. Provide performance improvement for multi-core computers

6.utf-8 encoding support, native support UTF-8


Practical applications and resources for go:

    1. YouTube (Google), the world's largest video site

    2. Seven Qiniu storage and network disk services (Q-disk)

    3. Well-known companies that have used go development on the server: Google, Shanda Network, seven KN, 360.


Install the Go language:

    1. Go source Installation

    2. Go Standard Pack installation

    3. Third-party tool installation


Go environment variables and working directory:

3 directories need to be created under Gopath:

    1. Bin: Store the compiled executable file

    2. PKG: Store the generated package files after compilation

    3. SRC: Store Project source code


Command line: Go env display GO environment variable configuration

Go common commands:

Go get: Get remote package, need to install Git or Hg in advance

Go run: Run the program directly

Go BUILD: Test compilation, check for compilation errors

Go FMT: Formatted source (some Ides are automatically called when saved)

Go install: Compile the package file and compile the entire program

Go test: Run the testing file

Go doc: View documentation (CHM manual)

Browse Go official website in browser: command line input: godoc-http=:8080 can be entered in browser: localhost:8080 view



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.