Difference between revisions for go
|
|
Next edit →
|
| Version1 | Version2 | Differences |
|---|---|---|
| 1 | %%(html) | |
| 1 | **go** in **archlinux** | |
| 2 | ||
| 3 | %%(html5) | |
| 4 | ||
| 5 | $ sudo pacman -S go go-tools | |
| 6 | ||
| 2 | 7 | |
| 3 | 8 | $ go version |
| 4 | 9 | go version go1.9.1 linux/amd64 |
| … | … | … |
| 10 | 15 | import "fmt" |
| 11 | 16 | // This is a demonstrative comment! |
| 12 | 17 | func main() { |
| 13 |
|
|
| 18 | fmt.Println("Hello World!") | |
| 14 | 19 | } |
| 15 | 20 | EOF |
| 16 | 21 | |
| … | … | … |
| 26 | 31 | Hello World! |
| 27 | 32 | |
| 28 | 33 | |
| 34 | $ cat helloworld.go | |
| 35 | package main | |
| 36 | import "fmt" | |
| 37 | // This is a demonstrative comment! | |
| 38 | func main() { | |
| 39 | fmt.Println("Hello World!") | |
| 40 | } | |
| 41 | ||
| 42 | $ gofmt helloworld.go | |
| 43 | package main | |
| 44 | ||
| 45 | import "fmt" | |
| 46 | ||
| 47 | // This is a demonstrative comment! | |
| 48 | func main() { | |
| 49 | fmt.Println("Hello World!") | |
| 50 | } | |
| 51 | ||
| 29 | 52 | %% |