From: Robert Griesemer Date: Mon, 1 Oct 2012 21:17:25 +0000 (-0700) Subject: cmd/godoc: clearer comments in FormatSelections X-Git-Tag: go1.1rc2~2280 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5a03cd56a18302b24ef7b6110912cd2356360165;p=gostls13.git cmd/godoc: clearer comments in FormatSelections R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6561073 --- diff --git a/src/cmd/godoc/format.go b/src/cmd/godoc/format.go index 64f4b80305..f9cbdf53cd 100644 --- a/src/cmd/godoc/format.go +++ b/src/cmd/godoc/format.go @@ -54,6 +54,8 @@ type SegmentWriter func(w io.Writer, text []byte, selections int) // Selection is ignored. // func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection, sw SegmentWriter, selections ...Selection) { + // If we have a link writer, make the links + // selection the last entry in selections if lw != nil { selections = append(selections, links) } @@ -109,7 +111,7 @@ func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection, } // determine the kind of segment change if lw != nil && index == len(selections)-1 { - // we have a link segment change: + // we have a link segment change (see start of this function): // format the previous selection segment, write the // link tag and start a new selection segment segment(offs)