aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar jcgregorio <jcgregorio@google.com>2014-10-20 10:44:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-20 10:44:35 -0700
commit33e6466a4faa3a58202bf056b50fdcd9dc34cc22 (patch)
treede3ef90d0e9906ee2c16388b58e17e12976d833b /experimental
parentdba3e64ab9bbeac5a8b4fed6d03665cc7a5cf514 (diff)
Move init() to Init() so that flag.Parse() can be called first.
Otherwise the --log_dir flag doesn't affect where glog output goes to. TBR=humper BUG=skia: Review URL: https://codereview.chromium.org/667493002
Diffstat (limited to 'experimental')
-rw-r--r--experimental/webtry/webtry.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go
index 2096f7d778..830859c08b 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))