diff --git a/pkg/wsapi/api.go b/pkg/wsapi/api.go index a15d6a4..f07cf39 100644 --- a/pkg/wsapi/api.go +++ b/pkg/wsapi/api.go @@ -23,15 +23,15 @@ var ( type Type string type MsgBase struct { - ID *int `json:"id,omitempty"` + ID *int `json:"id,omitempty"` Type Type `json:"type"` } type ( wsSession struct { - conn *websocket.Conn - b core.Blas - ec echo.Context + conn *websocket.Conn + b core.Blas + ec echo.Context write chan<- interface{} user *auth.User @@ -97,7 +97,7 @@ func (ws *wsSession) Go(ctx context.Context) error { if err != nil { return err } - + _, rdr, err := ws.conn.NextReader() if err != nil { return err @@ -213,13 +213,13 @@ func (ws *wsSession) handleMsg(ctx context.Context, msgMap map[string]interface{ idFl, ok := msgMap["id"].(float64) if !ok { ws.Write(WSError{ - Type: ResultMsgType, - Success: false, - Error: Error{ - Code: "invalid_id", - Message: "command has no ID", - }, - }) + Type: ResultMsgType, + Success: false, + Error: Error{ + Code: "invalid_id", + Message: "command has no ID", + }, + }) return nil }