Go language course


Release date:2023-09-07 Update date:2023-10-13 Editor:admin View counts:311

Label:

Go language course

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Go was developed by Robert Griesemer, Rob Pike, Ken Thompson at the end of 2007, and later joined Ian Lance Taylor, Russ Cox and others, and finally opened source in November 2009, and released a stable version of Go 1in early 2012. Now the development of Go is completely open and has an active community.

../../_images/go128.png

Go language features

  • Concise, fast and safe

  • Parallel, interesting, open source

  • Memory management, array security, fast compilation

Go language usage

The Go language is designed to be used in carrying Web system programming language for servers, storage clusters or giant central servers for similar purposes.

For the field of high-performance distributed systems Go languages are undoubtedly more efficient than most other languages. It provides massive support for parallelism, which is great for game server development.

The first Go program

Next, let’s write the first Go program hello.go ( Go extension of the language source file is .go ), the code is as follows:

hello.go file

package main
import "fmt"
func main() {
    fmt.Println("Hello, World!")
}

To execute Go language code can be used go run orders.

Execute the above code output:

$ go run hello.go
Hello, World!

In addition, we can also use go build command to generate binaries:

$ go build hello.go
$ ls
hello    hello.go
$ ./hello
Hello, World!

Powered by TorCMS (https://github.com/bukun/TorCMS).