Commit 5a03cd56 authored by Robert Griesemer's avatar Robert Griesemer

cmd/godoc: clearer comments in FormatSelections

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6561073
parent 3f7fb918
...@@ -54,6 +54,8 @@ type SegmentWriter func(w io.Writer, text []byte, selections int) ...@@ -54,6 +54,8 @@ type SegmentWriter func(w io.Writer, text []byte, selections int)
// Selection is ignored. // Selection is ignored.
// //
func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection, sw SegmentWriter, selections ...Selection) { 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 { if lw != nil {
selections = append(selections, links) selections = append(selections, links)
} }
...@@ -109,7 +111,7 @@ func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection, ...@@ -109,7 +111,7 @@ func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection,
} }
// determine the kind of segment change // determine the kind of segment change
if lw != nil && index == len(selections)-1 { 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 // format the previous selection segment, write the
// link tag and start a new selection segment // link tag and start a new selection segment
segment(offs) segment(offs)
......
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