Akik Look at that coder

Public number: look at that code farmers

1. Introduction to this article

  • The Go language
  • Install the Go language on the Windows and Linux platforms

2. The Go language

1. The origin of the Go language

Go is a new language and has been loved by everyone since its appearance.

Go is an open source programming language developed by Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. These computer science heavyweights originally designed Go to meet Google’s needs, incorporating ideas from Pascal, Oberon, and C.

  • Ken Thompson implemented the original UNIX operating system in the 1970s
  • Rob Pike and Ken Thompson designed the UTF-8 coding scheme

The Google Open Source Blog released the language to the world in 2009.

The main goal of Go is to combine the development speed of dynamic statements such as Python with the performance and security of compiled languages such as C/C++. Go is a static, compiled programming language with built-in garbage collection and concurrency.

2. The project of Go language development

Go is a programming language for cloud computing. Companies including Amazon, Apple, Disney, Facebook, General Electric, Google, And Microsoft are all using Go to develop important projects.

List some projects that use Go native

1. The Docker project

Address: github.com/docker/dock…

Docker is an operating system-level virtualization technology that provides isolation between the operating system and the application, also known as a container.

2. Golang project

Address: github.com/golang/go

The early source code for Go was written in C and assembly language. Since Go1.5, it has been written entirely in the Go language itself.

3. Kubernetes project

Address: github.com/kubernetes/…

This project is a container scheduling service developed by Google and built on top of Docker. Users can manage cloud container clusters through Kubernetes cluster.

4. Etcd project

Address: github.com/coreos/etcd

The project is a distributed, reliable KV storage system that can be quickly configured in the cloud.

5. Beego project

Address: github.com/astaxie/bee…

The project is a Python-like Tornada framework, a very lightweight, highly scalable, high-performance Web application framework written in Go language with a RESTFul design.

3. Install the Go language on Windows and Linux

Go is available for operating systems such as FreeBSD, Linux, Windows and MacOS

The Go development kit can be downloaded at the following sites

The official Go website is golang.google.cn/dl/

  • Go1.16.2.src.tar. gz: Source code package for source research, not recommended for daily development
  • Go1.16.2. Darwin-amd64.pkg: Mac OS platform installation package
  • Go1.16.2.linux-amd64.tar. gz: indicates the Linux installation package
  • Go1.16.2.windows-amd64.msi: Windows platform installation package

1. Windows installation

Windows installation packages are usually named as follows:

Go1.16.2. Windows – amd64. Msi

  • 1.16.2 indicates the Go installation package version
  • Windows means this is a Windows installation package
  • Amd64 indicates the matched CPU version. Here indicates the matched 64-bit CPU

1. Start the installation

2. Set the installation directory

3. It feels quick to install

4. It was quickly installed

5. Several files are generated in the installation directory

  • API: Differences in API changes from version to version
  • Bin :go source package compiler (go), documentation tool (godoc), formatting tool (gofmt)
  • Doc: An English version of the GO document
  • Lib: library files to reference
  • Misc: Files for other purposes, such as the compilation of Android
  • PKG: intermediate file compiled on the Windows platform
  • SRC: source code for the standard library
  • Test: test case

6. Set environment variables

  • Add the variable name “GoPath” to the environment variable,
  • The value is the bin file path in the Go installation path.

7. Check whether go is successfully configured and installed

To invoke the command prompt, type:

go version

Check whether go is configured and installed successfully

Configuration is successful

2. Install Linux

The file name:

Go1.16.2. Linux – amd64. Tar. Gz

  • 1.16.2 indicates the Go installation package version
  • Linux indicates that this is a Linux installation package
  • Amd64 indicates the matched CPU version. Here indicates the matched 64-bit CPU

1. Unpack the

First, you need to decompress the download package to /user/local/go

tar -C /user/local/go -xzf go116.2..linux-amd64.tar.gz
Copy the code

2. Environment variables

Next, you need to add the /user/local/go/bin directory to the PATH environment variable, which you can do using the following command line

export PATH=$PATH:/user/local/go/bin
Copy the code

3. Verify the view

Finally, run the go env command to check whether the go compression package is successfully installed.

go env
Copy the code

If you find this helpful:

1. Like it so more people can see it

2, pay attention to the public number: see the code farmer, we learn together and progress together.

This article is participating in the “Nuggets 2021 Spring Recruiting activity”, click to see the details of the activity