| 38 |
|
| 39 |
$ cat helloworld.go |
| 40 |
package main |
| 41 |
import "fmt" |
| 42 |
// This is a demonstrative comment! |
| 43 |
func main() { |
| 44 |
fmt.Println("Hello World!") |
| 45 |
} |
| 46 |
%% |
| 47 |
|
| 48 |
%% |
| 49 |
$ gofmt helloworld.go |
| 50 |
package main |
| 51 |
|
| 52 |
import "fmt" |
| 53 |
|
| 54 |
// This is a demonstrative comment! |
| 55 |
func main() { |
| 56 |
fmt.Println("Hello World!") |
| 57 |
} |
| 58 |
|
| 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 |
%% |