From 0ebfa231d21b255d84cfdb8a618cfe397db6c497 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 15 Sep 2009 09:41:59 -0700 Subject: more "declared and not used". the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638 --- src/pkg/go/doc/comment.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pkg/go/doc/comment.go') diff --git a/src/pkg/go/doc/comment.go b/src/pkg/go/doc/comment.go index 0550e7331..de127ff4b 100644 --- a/src/pkg/go/doc/comment.go +++ b/src/pkg/go/doc/comment.go @@ -43,13 +43,13 @@ func setupRegexps() { func commentText(comments []string) string { once.Do(setupRegexps); lines := make([]string, 0, 20); - for i, c := range comments { + for _, c := range comments { // split on newlines cl := strings.Split(c, "\n", 0); // walk lines, stripping comment markers w := 0; - for j, l := range cl { + for _, l := range cl { // remove /* and */ lines if comment_junk.MatchString(l) { continue; @@ -85,7 +85,7 @@ func commentText(comments []string) string { // add this comment to total list // TODO: maybe separate with a single blank line // if there is already a comment and len(cl) > 0? - for j, l := range cl { + for _, l := range cl { n := len(lines); if n+1 >= cap(lines) { newlines := make([]string, n, 2*cap(lines)); @@ -205,7 +205,7 @@ func unindent(block [][]byte) { // compute maximum common white prefix prefix := block[0][0 : indentLen(block[0])]; - for i, line := range block { + for _, line := range block { if !isBlank(line) { prefix = commonPrefix(prefix, line[0 : indentLen(line)]); } @@ -288,7 +288,7 @@ func ToHtml(w io.Writer, s []byte) { // they don't get the nice text formatting, // just html escaping w.Write(html_pre); - for k, line := range block { + for _, line := range block { template.HtmlEscape(w, line); } w.Write(html_endpre); -- cgit v1.2.3