diff --git a/go/server.go b/go/server.go index ae06188..a3e17ed 100644 --- a/go/server.go +++ b/go/server.go @@ -8,7 +8,6 @@ package main import ( - "encoding/json" "flag" "log" "net/http" @@ -24,20 +23,6 @@ var upgrader = websocket.Upgrader{ WriteBufferSize: 2048, } -type Pixel struct { - X uint16 `json:"x"` - Y uint16 `json:"y"` - Color uint8 `json:"color"` - Timestamp int64 `json:"timestamp"` - UserID uint64 `json:"userid"` -} - -func JsonToStruct(input []byte) Pixel { - pixel := Pixel{} - json.Unmarshal(input, &pixel) - return pixel -} - func serve(w http.ResponseWriter, r *http.Request) { c, err := upgrader.Upgrade(w, r, nil) if err != nil { diff --git a/go/util.go b/go/util.go index 33b6e44..4662bf4 100644 --- a/go/util.go +++ b/go/util.go @@ -8,7 +8,7 @@ type Pixel struct { X uint16 `json:"x"` Y uint16 `json:"y"` Color uint8 `json:"color"` - Timestamp uint64 `json:"timestamp"` + Timestamp int64 `json:"timestamp"` UserID uint64 `json:"userid"` }