1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:14:47 -07:00

doc/tmptohtml: output fix

R=r, gri
CC=golang-dev
https://golang.org/cl/5441047
This commit is contained in:
Christopher Wedgwood 2011-11-28 09:50:40 -08:00 committed by Robert Griesemer
parent b57bb9282e
commit 62203141ac

View File

@ -141,7 +141,7 @@ func multipleLines(file, text string, arg1, arg2 interface{}) string {
if !isInt2 { if !isInt2 {
line2 = match(file, line1, lines, pattern2) line2 = match(file, line1, lines, pattern2)
} else if line2 < line1 { } else if line2 < line1 {
log.Fatal("lines out of order for %q: %d %d", line1, line2) log.Fatalf("lines out of order for %q: %d %d", text, line1, line2)
} }
return strings.Join(lines[line1-1:line2], "") return strings.Join(lines[line1-1:line2], "")
} }
@ -153,7 +153,7 @@ func match(file string, start int, lines []string, pattern string) int {
// $ matches the end of the file. // $ matches the end of the file.
if pattern == "$" { if pattern == "$" {
if len(lines) == 0 { if len(lines) == 0 {
log.Fatal("%q: empty file", file) log.Fatalf("%q: empty file", file)
} }
return len(lines) return len(lines)
} }