Difference between revisions for go





Next edit →

Version1 Version2
1 %%(html) 1 **go** in **archlinux**
    2
    3 %%(html5)
    4
    5 $ sudo pacman -S go go-tools
    6
2 7
3 $ go version 8 $ go version
4 go version go1.9.1 linux/amd64 9 go version go1.9.1 linux/amd64
… … … …
10 import "fmt" 15 import "fmt"
11 // This is a demonstrative comment! 16 // This is a demonstrative comment!
12 func main() { 17 func main() {
13    fmt.Println("Hello World!") 18 fmt.Println("Hello World!")
14 } 19 }
15 EOF 20 EOF
16 21
… … … …
26 Hello World! 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 %%