Commit 6a71a463 authored by Robert Griesemer's avatar Robert Griesemer

godoc: don't print package clause in -src command-line mode with filtering

R=rsc
CC=golang-dev
https://golang.org/cl/844041
parent 01eaf780
......@@ -355,7 +355,18 @@ func main() {
switch {
case info.PAst != nil:
ast.FilterFile(info.PAst, filter)
info.PAst.Doc = nil // don't show package comment in this case
// Special case: Don't use templates for printing
// so we only get the filtered declarations without
// package clause or extra whitespace.
for i, d := range info.PAst.Decls {
if i > 0 {
fmt.Println()
}
writeAny(os.Stdout, d, *html)
fmt.Println()
}
return
case info.PDoc != nil:
info.PDoc.Filter(filter)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment