{{with .PDoc}} {{if $.IsMain}} {{/* command documentation */}} {{comment_html .Doc}} {{else}} {{/* package documentation */}}
import "{{html .ImportPath}}"
Overview
Index
{{if $.Examples}}
Examples
{{end}} {{if $.Dirs}}
Subdirectories
{{end}}

Overview ▾

{{comment_html .Doc}} {{example_html $ ""}}

Index ▾

{{if .Consts}}
Constants
{{end}} {{if .Vars}}
Variables
{{end}} {{range .Funcs}} {{$name_html := html .Name}}
{{node_html $ .Decl false | sanitize}}
{{end}} {{range .Types}} {{$tname_html := html .Name}}
type {{$tname_html}}
{{range .Funcs}} {{$name_html := html .Name}}
    {{node_html $ .Decl false | sanitize}}
{{end}} {{range .Methods}} {{$name_html := html .Name}}
    {{node_html $ .Decl false | sanitize}}
{{end}} {{end}} {{if $.Notes}} {{range $marker, $item := $.Notes}}
{{noteTitle $marker | html}}s
{{end}} {{end}}
{{if $.Examples}}

Examples

{{range $.Examples}}
{{example_name .Name}}
{{end}}
{{end}} {{with .Filenames}}

Package files

{{range .}} {{.|filename|html}} {{end}}

{{end}}
{{with .Consts}}

Constants

{{range .}} {{comment_html .Doc}}
{{node_html $ .Decl true}}
{{end}} {{end}} {{with .Vars}}

Variables

{{range .}} {{comment_html .Doc}}
{{node_html $ .Decl true}}
{{end}} {{end}} {{range .Funcs}} {{/* Name is a string - no need for FSet */}} {{$name_html := html .Name}}

func {{$name_html}} {{$since := since "func" "" .Name $.PDoc.ImportPath}} {{if $since}}{{$since}}{{end}}

{{node_html $ .Decl true}}
{{comment_html .Doc}} {{example_html $ .Name}} {{callgraph_html $ "" .Name}} {{end}} {{range .Types}} {{$tname := .Name}} {{$tname_html := html .Name}}

type {{$tname_html}} {{$since := since "type" "" .Name $.PDoc.ImportPath}} {{if $since}}{{$since}}{{end}}

{{comment_html .Doc}}
{{node_html $ .Decl true}}
{{range .Consts}} {{comment_html .Doc}}
{{node_html $ .Decl true}}
{{end}} {{range .Vars}} {{comment_html .Doc}}
{{node_html $ .Decl true}}
{{end}} {{example_html $ $tname}} {{implements_html $ $tname}} {{methodset_html $ $tname}} {{range .Funcs}} {{$name_html := html .Name}}

func {{$name_html}} {{$since := since "func" "" .Name $.PDoc.ImportPath}} {{if $since}}{{$since}}{{end}}

{{node_html $ .Decl true}}
{{comment_html .Doc}} {{example_html $ .Name}} {{callgraph_html $ "" .Name}} {{end}} {{range .Methods}} {{$name_html := html .Name}}

func ({{html .Recv}}) {{$name_html}} {{$since := since "method" .Recv .Name $.PDoc.ImportPath}} {{if $since}}{{$since}}{{end}}

{{node_html $ .Decl true}}
{{comment_html .Doc}} {{$name := printf "%s_%s" $tname .Name}} {{example_html $ $name}} {{callgraph_html $ .Recv .Name}} {{end}} {{end}} {{end}} {{with $.Notes}} {{range $marker, $content := .}}

{{noteTitle $marker | html}}s

{{end}} {{end}} {{end}} {{with .PAst}} {{range $filename, $ast := .}} {{$filename|filename|html}}:
{{node_html $ $ast false}}
{{end}} {{end}} {{with .Dirs}} {{/* DirList entries are numbers and strings - no need for FSet */}} {{if $.PDoc}}

Subdirectories

{{end}}
{{if not ((eq $.Dirname "/src/cmd") $.DirFlat)}} {{end}} {{range .List}} {{if $.DirFlat}} {{if .HasPkg}} {{end}} {{else}} {{end}} {{end}}
Name Synopsis
..
{{html .Path}} {{html .Name}} {{html .Synopsis}}
{{end}}