aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar tfarina <tfarina@chromium.org>2014-10-10 18:40:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-10 18:40:45 -0700
commit10c2c74d5003b0d8e9b134f92b0c791eb6733fec (patch)
treef99c2fc4a02e4e066d4b0133db10628ce3db31ab /tools
parenta5305a110ab5201d5dadd40cbe711582d5ac4996 (diff)
bug_chomper: Use parenthesized declaration style for const and vars.
It seems cleaner that way and nicer to read, also avoids repeating 'const' and 'var' everytime you have to add more items. BUG=None TEST=./run_server.sh R=borenet@google.com Review URL: https://codereview.chromium.org/645803003
Diffstat (limited to 'tools')
-rw-r--r--tools/bug_chomper/src/server/server.go46
1 files changed, 25 insertions, 21 deletions
diff --git a/tools/bug_chomper/src/server/server.go b/tools/bug_chomper/src/server/server.go
index 9fb21ed594..a20c679107 100644
--- a/tools/bug_chomper/src/server/server.go
+++ b/tools/bug_chomper/src/server/server.go
@@ -29,30 +29,34 @@ import (
import "github.com/gorilla/securecookie"
-const certFile = "certs/cert.pem"
-const keyFile = "certs/key.pem"
-const issueComment = "Edited by BugChomper"
-const oauthCallbackPath = "/oauth2callback"
-const oauthConfigFile = "oauth_client_secret.json"
-const defaultPort = 8000
-const localHost = "127.0.0.1"
-const maxSessionLen = time.Duration(3600 * time.Second)
-const priorityPrefix = "Priority-"
-const project = "skia"
-const cookieName = "BugChomperCookie"
+const (
+ certFile = "certs/cert.pem"
+ keyFile = "certs/key.pem"
+ issueComment = "Edited by BugChomper"
+ oauthCallbackPath = "/oauth2callback"
+ oauthConfigFile = "oauth_client_secret.json"
+ defaultPort = 8000
+ localHost = "127.0.0.1"
+ maxSessionLen = time.Duration(3600 * time.Second)
+ priorityPrefix = "Priority-"
+ project = "skia"
+ cookieName = "BugChomperCookie"
+)
-var scheme = "http"
+var (
+ scheme = "http"
-var curdir, _ = filepath.Abs(".")
-var templatePath, _ = filepath.Abs("templates")
-var templates = template.Must(template.ParseFiles(
- path.Join(templatePath, "bug_chomper.html"),
- path.Join(templatePath, "submitted.html"),
- path.Join(templatePath, "error.html")))
+ curdir, _ = filepath.Abs(".")
+ templatePath, _ = filepath.Abs("templates")
+ templates = template.Must(template.ParseFiles(
+ path.Join(templatePath, "bug_chomper.html"),
+ path.Join(templatePath, "submitted.html"),
+ path.Join(templatePath, "error.html")))
-var hashKey = securecookie.GenerateRandomKey(32)
-var blockKey = securecookie.GenerateRandomKey(32)
-var secureCookie = securecookie.New(hashKey, blockKey)
+ hashKey = securecookie.GenerateRandomKey(32)
+ blockKey = securecookie.GenerateRandomKey(32)
+ secureCookie = securecookie.New(hashKey, blockKey)
+)
// SessionState contains data for a given session.
type SessionState struct {