Golang QuickStart
来自Jack's Lab
(版本间的差异)
(→Basics) |
(→Hello) |
||
第37行: | 第37行: | ||
$ go run hello.go | $ go run hello.go | ||
Hello, World! | Hello, World! | ||
− | + | $ | |
$ go build hello.go | $ go build hello.go | ||
$ ./hello | $ ./hello |
2017年6月8日 (四) 07:58的版本
目录 |
1 Prepare
Install the Go lang:
$ sudo apt-get install golang-go
Install a library:
$ sudo apt-get install golang-eclipse-paho-dev $ export GOPATH=/usr/share/gocode
Refer to:
2 Hello
$ cat hello.go package main import "fmt" func main() { fmt.Println("Hello, World!") } $ go run hello.go Hello, World! $ $ go build hello.go $ ./hello Hello, World!
3 Basics
4 Operators
5 Control Flow
6 Functions
7 Data Structures
8 Exceptions
9 Modules
10 Resource