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

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

Issue 4572065: code review 4572065: godoc: replace direct OS file system accesses in favor (Closed)
Left Patch Set: diff -r ecb31be11487 https://go.googlecode.com/hg/ Created 12 years, 9 months ago
Right Patch Set: diff -r d086bab9b037 https://go.googlecode.com/hg/ Created 12 years, 9 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/godoc/filesystem.go ('k') | 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
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 package main 5 package main
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "flag" 9 "flag"
10 "fmt" 10 "fmt"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 590
591 591
592 // Template formatter for "time" format. 592 // Template formatter for "time" format.
593 func timeFmt(w io.Writer, format string, x ...interface{}) { 593 func timeFmt(w io.Writer, format string, x ...interface{}) {
594 template.HTMLEscape(w, []byte(time.SecondsToLocalTime(x[0].(int64)/1e9). String())) 594 template.HTMLEscape(w, []byte(time.SecondsToLocalTime(x[0].(int64)/1e9). String()))
595 } 595 }
596 596
597 597
598 // Template formatter for "dir/" format. 598 // Template formatter for "dir/" format.
599 func dirslashFmt(w io.Writer, format string, x ...interface{}) { 599 func dirslashFmt(w io.Writer, format string, x ...interface{}) {
600 » if x[0].(*os.FileInfo).IsDirectory() { 600 » if x[0].(FileInfo).IsDirectory() {
601 w.Write([]byte{'/'}) 601 w.Write([]byte{'/'})
602 } 602 }
603 } 603 }
604 604
605 605
606 // Template formatter for "localname" format. 606 // Template formatter for "localname" format.
607 func localnameFmt(w io.Writer, format string, x ...interface{}) { 607 func localnameFmt(w io.Writer, format string, x ...interface{}) {
608 _, localname := filepath.Split(x[0].(string)) 608 _, localname := filepath.Split(x[0].(string))
609 template.HTMLEscape(w, []byte(localname)) 609 template.HTMLEscape(w, []byte(localname))
610 } 610 }
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 log.Printf("after GC: bytes = %d footprint = %d", runti me.MemStats.HeapAlloc, runtime.MemStats.Sys) 1281 log.Printf("after GC: bytes = %d footprint = %d", runti me.MemStats.HeapAlloc, runtime.MemStats.Sys)
1282 } 1282 }
1283 var delay int64 = 60 * 1e9 // by default, try every 60s 1283 var delay int64 = 60 * 1e9 // by default, try every 60s
1284 if *testDir != "" { 1284 if *testDir != "" {
1285 // in test mode, try once a second for fast startup 1285 // in test mode, try once a second for fast startup
1286 delay = 1 * 1e9 1286 delay = 1 * 1e9
1287 } 1287 }
1288 time.Sleep(delay) 1288 time.Sleep(delay)
1289 } 1289 }
1290 } 1290 }
LEFTRIGHT

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