Вот небольшая программа toto.go
// Copyright Some Company Corp.
// All Rights Reserved
package main
// here are the imports
import (
"fmt"
)
// function to say hello
func hello() {
fmt.Println("hello world")
}
// Main function here
func main() {
hello()
}
Как сгенерировать HTML-документацию из этого кода?
Результат:
godoc -html github.com/bussiere/GoTestDoc
flag provided but not defined: -html
usage: godoc -http=localhost:6060
-analysis string
comma-separated list of analyses to perform (supported: type, pointer). See http://golang.org/lib/godoc/analysis/help.html
-goroot string
Go root directory (default "/usr/lib/go-1.13")
-http string
HTTP service address (default "localhost:6060")
-index
enable search index
-index_files string
glob pattern specifying index files; if not empty, the index is read from these files in sorted order
-index_interval duration
interval of indexing; 0 for default (5m), negative to only index once at startup
-index_throttle float
index throttle value; 0.0 = no time allocated, 1.0 = full throttle (default 0.75)
-links
link identifiers to their declarations (default true)
-maxresults int
maximum number of full text search results shown (default 10000)
-notes string
regular expression matching note markers to show (default "BUG")
-play
enable playground
-templates string
load templates/JS/CSS from disk in this directory
-timestamps
show timestamps with directory listings
-url string
print HTML for named URL
-v verbose mode
-write_index
write index to a file; the file name must be specified with -index_files
-zip string
zip file providing the file system to serve; disabled if empty
Так кажетсямногое изменилось с прошлого раза. И, кажется, трудно найти учебник и документацию, чтобы сделать документ для golang в go1.13