Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(73)

Delta Between Two Patch Sets: src/cmd/godoc/codewalk.go

Issue 4631098: code review 4631098: sort: rename helpers: s/Sort// in sort.Sort[Float64s|In... (Closed)
Left Patch Set: Created 12 years, 8 months ago
Right Patch Set: diff -r e276ba524959 https://go.googlecode.com/hg/ Created 12 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/cmd/godoc/index.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // The /doc/codewalk/ tree is synthesized from codewalk descriptions, 5 // The /doc/codewalk/ tree is synthesized from codewalk descriptions,
6 // files named $GOROOT/doc/codewalk/*.xml. 6 // files named $GOROOT/doc/codewalk/*.xml.
7 // For an example and a description of the format, see 7 // For an example and a description of the format, see
8 // http://golang.org/doc/codewalk/codewalk or run godoc -http=:6060 8 // http://golang.org/doc/codewalk/codewalk or run godoc -http=:6060
9 // and see http://localhost:6060/doc/codewalk/codewalk . 9 // and see http://localhost:6060/doc/codewalk/codewalk .
10 // That page is itself a codewalk; the source code for it is 10 // That page is itself a codewalk; the source code for it is
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 m[filename] = true 161 m[filename] = true
162 } 162 }
163 163
164 // Make list of files 164 // Make list of files
165 cw.File = make([]string, len(m)) 165 cw.File = make([]string, len(m))
166 i := 0 166 i := 0
167 for f := range m { 167 for f := range m {
168 cw.File[i] = f 168 cw.File[i] = f
169 i++ 169 i++
170 } 170 }
171 » sort.SortStrings(cw.File) 171 » sort.Strings(cw.File)
172 172
173 return cw, nil 173 return cw, nil
174 } 174 }
175 175
176 176
177 // codewalkDir serves the codewalk directory listing. 177 // codewalkDir serves the codewalk directory listing.
178 // It scans the directory for subdirectories or files named *.xml 178 // It scans the directory for subdirectories or files named *.xml
179 // and prepares a table. 179 // and prepares a table.
180 func codewalkDir(w http.ResponseWriter, r *http.Request, relpath, abspath string ) { 180 func codewalkDir(w http.ResponseWriter, r *http.Request, relpath, abspath string ) {
181 type elem struct { 181 type elem struct {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 for j, c := range data { 490 for j, c := range data {
491 if j == i { 491 if j == i {
492 return l 492 return l
493 } 493 }
494 if c == '\n' { 494 if c == '\n' {
495 l++ 495 l++
496 } 496 }
497 } 497 }
498 return l 498 return l
499 } 499 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b