Skip to content
Snippets Groups Projects
Commit 19dcda6f authored by bingyanglin's avatar bingyanglin
Browse files

update_error_check

parent 27eab545
Branches
Tags
No related merge requests found
...@@ -11,11 +11,11 @@ import ( ...@@ -11,11 +11,11 @@ import (
) )
var ( var (
_, filename, _, _ = runtime.Caller(0) _, filename, _, runtime_ok = runtime.Caller(0)
Clients = make(map[*websocket.Conn]bool) Clients = make(map[*websocket.Conn]bool)
templPath = filepath.Join(filepath.Dir(filename), "./dashboard.html") templPath = filepath.Join(filepath.Dir(filename), "./dashboard.html")
homeTempl, _ = template.ParseFiles(templPath) homeTempl, _ = template.ParseFiles(templPath)
upgrader = websocket.Upgrader{ upgrader = websocket.Upgrader{
ReadBufferSize: 1024, ReadBufferSize: 1024,
WriteBufferSize: 1024, WriteBufferSize: 1024,
} }
...@@ -44,6 +44,9 @@ func ServeHome(w http.ResponseWriter, r *http.Request) { ...@@ -44,6 +44,9 @@ func ServeHome(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
return return
} }
if !runtime_ok {
panic("Server runtime caller error")
}
var v = struct { var v = struct {
Host string Host string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment