From ee6d416611c346b0ab2a71ac2f95f4f429962c13 Mon Sep 17 00:00:00 2001 From: Askill Date: Thu, 26 May 2022 15:01:09 +0200 Subject: [PATCH] clean up --- go/server.go | 15 --------------- go/util.go | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) 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"` }