Getting Started with Go in 3 Minutes

Go language, also known as GoLang.

  • Go language is an open source programming language developed by Google
  • Static strongly typed, compiled language with syntax close to C
  • With garbage collection function

The Go language was designed in 2007 and officially launched in 2009. Based on the inferno system development, it has gradually implemented Linux, Mac OS and Windows versions.

Go language environment construction

To develop code in Go language, you need to install the Go language environment like installing JDK. The download address is as follows:

Here is a demonstration with Windows operating system, download the Windows version of the Go environment installation package: https://dl.google.com/go/go1.18.windows-amd64.msi .

After downloading, click Install and continue to the next step.
After the installation is complete, open a new command window and enter go versionit. If the installed version information can be displayed correctly, the installation is successful, as shown below.

D:\>go version
go version go1.18 windows/amd64

Getting started example

  1. Create a Go source file in the directory, hello.go, with the following contents:
package main

import "fmt"

func main() {
	fmt.Println("Hello World!")
}
  1. Run
    the command line to switch to the Go source file path, and execute the following command. The
    go run hello.go
    following input means the execution is successful:
    insert image description here

Go language features

  • Good performance, parallel processing
  • Quick start, concise code

Applicable scene

The scenarios in which the Go language can be applied are:

  • As a server-side programming language, it can handle logging, virtual machine processing, file systems, distributed systems, database agents.
  • Programming as a Network: Web Apps, API Apps, Download Apps
  • As an in-memory database, cloud platform

Projects developed in Go language:

  • Cloud computing infrastructure: docker , kubernetes, etcd, consul, cloudflare CDN, Qiniu cloud storage, etc.
  • Microservices: go-kit, micro, monzo bank's typhon, bilibili, etc.

Companies using Go language:

  • Overseas: Google, Docker, Apple, Cloud Foundry, CloudFlare, Couchbase, CoreOS, Dropbox, MongoDB, AWS and other companies;
  • Domestic: Alibaba Cloud CDN, Baidu, Xiaomi, Qiniu, PingCAP, Huawei, Kingsoft, Cheetah Mobile, Ele.me, etc.


Guess you like

Origin blog.csdn.net/oscar999/article/details/124135753