mirror of
https://github.com/golang/go
synced 2024-11-22 14:54:46 -07:00
ab169c6e3f
The main change is simple: Both the Directory and DirEntry struct have an extra field 'HasPkg' indicating whether the directory contains any package files. The remaining changes are more comments and adjustments to the template files. Fixes #3121. R=golang-dev, bradfitz, sameer CC=golang-dev https://golang.org/cl/5699072
84 lines
1.6 KiB
Plaintext
84 lines
1.6 KiB
Plaintext
{{with .PAst}}{{node . $.FSet}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE
|
|
|
|
package {{.Name}}
|
|
import "{{.ImportPath}}"
|
|
|
|
{{else}}COMMAND DOCUMENTATION
|
|
|
|
{{end}}{{comment_text .Doc " " "\t"}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Consts}}
|
|
CONSTANTS
|
|
|
|
{{range .}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}{{end}}
|
|
{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Vars}}
|
|
VARIABLES
|
|
|
|
{{range .}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}{{end}}
|
|
{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Funcs}}
|
|
FUNCTIONS
|
|
|
|
{{range .}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Types}}
|
|
TYPES
|
|
|
|
{{range .}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{range .Consts}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{range .Vars}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{range .Funcs}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{range .Methods}}{{node .Decl $.FSet}}
|
|
{{comment_text .Doc " " "\t"}}
|
|
{{end}}{{end}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Bugs}}
|
|
BUGS
|
|
|
|
{{range .}}{{comment_text . " " "\t"}}
|
|
{{end}}{{end}}{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .PList}}
|
|
OTHER PACKAGES
|
|
|
|
{{range .}}
|
|
{{.}}{{end}}
|
|
{{end}}{{/*
|
|
|
|
---------------------------------------
|
|
|
|
*/}}{{with .Dirs}}
|
|
SUBDIRECTORIES
|
|
{{if $.DirFlat}}{{range .List}}{{if .HasPkg}}
|
|
{{.Path}}{{end}}{{end}}
|
|
{{else}}{{range .List}}
|
|
{{repeat `. ` .Depth}}{{.Name}}{{end}}
|
|
{{end}}{{end}}
|