From: Robert Griesemer Date: Thu, 23 Feb 2012 07:38:18 +0000 (-0800) Subject: godoc: remove dead code X-Git-Tag: weekly.2012-03-04~200 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cbaf7ca032f0fb937cb4e49c94c7b681f0403d8a;p=gostls13.git godoc: remove dead code R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5698044 --- diff --git a/src/cmd/godoc/dirtrees.go b/src/cmd/godoc/dirtrees.go index 90f2c80ce7..b395f6014b 100644 --- a/src/cmd/godoc/dirtrees.go +++ b/src/cmd/godoc/dirtrees.go @@ -15,7 +15,6 @@ import ( "os" "path/filepath" "strings" - "unicode" ) type Directory struct { @@ -44,41 +43,6 @@ func isPkgDir(fi os.FileInfo) bool { name[0] != '_' && name[0] != '.' // ignore _files and .files } -func firstSentence(s string) string { - i := -1 // index+1 of first terminator (punctuation ending a sentence) - j := -1 // index+1 of first terminator followed by white space - prev := 'A' - for k, ch := range s { - k1 := k + 1 - if ch == '.' || ch == '!' || ch == '?' { - if i < 0 { - i = k1 // first terminator - } - if k1 < len(s) && s[k1] <= ' ' { - if j < 0 { - j = k1 // first terminator followed by white space - } - if !unicode.IsUpper(prev) { - j = k1 - break - } - } - } - prev = ch - } - - if j < 0 { - // use the next best terminator - j = i - if j < 0 { - // no terminator at all, use the entire string - j = len(s) - } - } - - return s[0:j] -} - type treeBuilder struct { pathFilter func(string) bool maxDepth int