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

Unified Diff: experimental/webtry/webtry.go

Issue 667493002: Move init() to Init() so that flag.Parse() can be called first. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/webtry.go
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go
index 2096f7d778f523c2a2dbf6d49c65e3f365c36b4c..830859c08b9ba0b8727a5d55e65df46676080110 100644
--- a/experimental/webtry/webtry.go
+++ b/experimental/webtry/webtry.go
@@ -139,7 +139,7 @@ func LineNumbers(c string) string {
return strings.Join(ret, "\n")
}
-func init() {
+func Init() {
rand.Seed(time.Now().UnixNano())
// Change the current working directory to the directory of the executable.
@@ -952,6 +952,7 @@ func mainHandler(w http.ResponseWriter, r *http.Request) {
func main() {
flag.Parse()
+ Init()
http.HandleFunc("/i/", autogzip.HandleFunc(imageHandler))
http.HandleFunc("/w/", autogzip.HandleFunc(workspaceHandler))
http.HandleFunc("/recent/", autogzip.HandleFunc(recentHandler))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698