mirror of
https://github.com/golang/go
synced 2024-11-25 19:07:57 -07:00
cmd/godoc: fix minor bug in FormatSelections.
FormatSelections tries to call a nil function value if lw is nil and the final entry in the selections array is non-nil. Luckily, this doesn't actually happen in practice since godoc doesn't use this combination (no line numbers, but with selections). R=gri CC=gobot, golang-dev https://golang.org/cl/6488106
This commit is contained in:
parent
32eb110277
commit
7c8e26ee2f
@ -108,7 +108,7 @@ func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection,
|
||||
break
|
||||
}
|
||||
// determine the kind of segment change
|
||||
if index == len(selections)-1 {
|
||||
if lw != nil && index == len(selections)-1 {
|
||||
// we have a link segment change:
|
||||
// format the previous selection segment, write the
|
||||
// link tag and start a new selection segment
|
||||
|
Loading…
Reference in New Issue
Block a user