summaryrefslogtreecommitdiff
path: root/src/pkg/go/doc/comment.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-09-15 09:41:59 -0700
committerRuss Cox <rsc@golang.org>2009-09-15 09:41:59 -0700
commit0ebfa231d21b255d84cfdb8a618cfe397db6c497 (patch)
tree46eac6aefe26f0b9056bff646d960bcba3d076cf /src/pkg/go/doc/comment.go
parentc67478eb2cfefebf09d0c648efa24bb9578078ba (diff)
downloadgolang-0ebfa231d21b255d84cfdb8a618cfe397db6c497.tar.gz
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
Diffstat (limited to 'src/pkg/go/doc/comment.go')
-rw-r--r--src/pkg/go/doc/comment.go10
1 files changed, 5 insertions, 5 deletions
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);