Go Language course

Go Is an open source programming language , It makes the structure simple 、 Reliable and efficient software becomes easy .

Go It's from 2007 At the end of the year by Robert Griesemer, Rob Pike, Ken Thompson Lead the development , Later I joined Ian Lance Taylor, Russ Cox wait forsomeone , And finally 2009 year 11 Month open source , stay 2012 Released earlier this year Go 1 Stable version . Now? Go The development of has been completely open , And have an active community .


Go Language features

  • concise 、 Fast 、 Safe
  • Parallel 、 Interesting 、 Open Source
  • Memory management 、 Array security 、 Compile quickly

Go Language use

Go The language is designed as an application language Web The server , System programming language for storage clusters or giant central servers for similar purposes .

For the field of high-performance distributed systems ,Go Language is undoubtedly more efficient than most other languages . It provides massive parallel support , This is the best for the development of game server .


first Go Program

Next, let's write the first Go Program hello.go(Go The 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!" )
}

Run instance »

To perform Go Language code can use go run Command .

Execute the above code output :

$ go run hello.go 
Hello, World!

In addition, we can use go build Command to generate binary files :

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