Difference between revisions for go
|
← Previous edit
|
Next edit →
|
| Version1 | Version2 | ||
|---|---|---|---|
| 19 | } | 19 | } |
| 20 | EOF | 20 | EOF |
| 21 | 21 | ||
| 22 | %% | ||
| 23 | |||
| 24 | %% | ||
| 22 | $ go run helloworld.go | 25 | $ go run helloworld.go |
| 23 | fork/exec /tmp/go-build127438955/command-line-arguments/_obj/exe/helloworld: permission denied | 26 | fork/exec /tmp/go-build127438955/command-line-arguments/_obj/exe/helloworld: permission denied |
| 24 | 27 | ||
| … | … | … | … |
| 29 | 32 | ||
| 30 | $ go run helloworld.go | 33 | $ go run helloworld.go |
| 31 | Hello World! | 34 | Hello World! |
| 35 | %% | ||
| 32 | 36 | ||
| 37 | %% | ||
| 33 | 38 | ||
| 34 | $ cat helloworld.go | 39 | $ cat helloworld.go |
| 35 | package main | 40 | package main |
| … | … | … | … |
| 38 | func main() { | 43 | func main() { |
| 39 | fmt.Println("Hello World!") | 44 | fmt.Println("Hello World!") |
| 40 | } | 45 | } |
| 46 | %% | ||
| 41 | 47 | ||
| 48 | %% | ||
| 42 | $ gofmt helloworld.go | 49 | $ gofmt helloworld.go |
| 43 | package main | 50 | package main |
| 44 | 51 | ||
| … | … | … | … |
| 50 | } | 57 | } |
| 51 | 58 | ||
| 52 | %% | 59 | %% |
| 60 | |||
| 61 | %% | ||
| 62 | |||
| 63 | $ godoc fmt | head | ||
| 64 | use 'godoc cmd/fmt' for documentation on the fmt command | ||
| 65 | |||
| 66 | PACKAGE DOCUMENTATION | ||
| 67 | |||
| 68 | package fmt | ||
| 69 | import "fmt" | ||
| 70 | |||
| 71 | %% | ||
| 72 | |||
| 73 | %% | ||
| 74 | ## The Go Programming Language - documentation in web server ! | ||
| 75 | |||
| 76 | $ godoc -http=:8181 | ||
| 77 | %% | ||