From 5e1bae3c4cac8aeac8c0b8b4311b760031fe4f00 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Thu, 30 Jul 2015 14:21:13 +0100 Subject: [PATCH] Fixing build issues --- web.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/web.go b/web.go index 9766c3c..48e3e53 100644 --- a/web.go +++ b/web.go @@ -28,17 +28,20 @@ type Page struct { var external_ip = "" func Webserver(port int) *WebServer { - return &WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)}.construct() -} + webserver := new(WebServer) + + webserver.port = port + webserver.client_token = make(map[*gumble.User]string) + webserver.token_client = make(map[string]*gumble.User) + + http.HandleFunc("/", webserver.homepage) + http.HandleFunc("/add", webserver.add) + http.HandleFunc("/volume", webserver.volume) + http.HandleFunc("/skip", webserver.skip) + http.ListenAndServe(":"+strconv.Itoa(port), nil) -func (web *WebServer) construct() *WebServer { - http.HandleFunc("/", web.homepage) - http.HandleFunc("/add", web.add) - http.HandleFunc("/volume", web.volume) - http.HandleFunc("/skip", web.skip) - http.ListenAndServe(":"+strconv.Itoa(web.port), nil) rand.Seed(time.Now().UnixNano()) - return web + return webserver } func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {