LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |