Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: golden/go/skiacorrectness/main.go

Issue 659943006: Do not forget to call `defer glog.Flush()` in our applications (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: revert titletool changes Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | monitoring/go/grains/grains.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package main 1 package main
2 2
3 import ( 3 import (
4 "flag" 4 "flag"
5 "net/http" 5 "net/http"
6 )
7 6
8 import (
9 "github.com/golang/glog" 7 "github.com/golang/glog"
10 ) 8 )
11 9
12 // flags 10 // Command line flags.
13 var ( 11 var (
14 port = flag.String("port", ":9000", "HTTP service address (e.g., ': 9000')") 12 port = flag.String("port", ":9000", "HTTP service address (e.g., ': 9000')")
15 staticDir = flag.String("static", "./app", "Directory with static conten t to serve") 13 staticDir = flag.String("static", "./app", "Directory with static conten t to serve")
16 14
17 // TODO (stephana): Just ideas to be sorted out later 15 // TODO (stephana): Just ideas to be sorted out later
18 // tempDir = flag.String("temp", "./.cache", 16 // tempDir = flag.String("temp", "./.cache",
19 // "Directory to store temporary file and application cache") 17 // "Directory to store temporary file and application cache")
20 ) 18 )
21 19
22 func main() { 20 func main() {
23 // parse the arguments
24 flag.Parse() 21 flag.Parse()
22 defer glog.Flush()
25 23
26 // // Static file handling
27 http.Handle("/", http.FileServer(http.Dir(*staticDir))) 24 http.Handle("/", http.FileServer(http.Dir(*staticDir)))
28 25
29 // Wire up the resources
30
31 // Start the server
32 glog.Infoln("Serving on http://127.0.0.1" + *port) 26 glog.Infoln("Serving on http://127.0.0.1" + *port)
33 glog.Fatal(http.ListenAndServe(*port, nil)) 27 glog.Fatal(http.ListenAndServe(*port, nil))
34 } 28 }
OLDNEW
« no previous file with comments | « no previous file | monitoring/go/grains/grains.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698