From cbaf7ca032f0fb937cb4e49c94c7b681f0403d8a Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 22 Feb 2012 23:38:18 -0800 Subject: [PATCH] godoc: remove dead code R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5698044 --- src/cmd/godoc/dirtrees.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) 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