fix base64 encode of jsons
This commit is contained in:
+1
-8
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -63,15 +62,9 @@ func sendMessageStructCloseIfTimeout(user *User, message *Message) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
jsonMsg, err := json.Marshal(message)
|
||||
if err != nil {
|
||||
log.Printf("json marshal error: %v", err)
|
||||
return
|
||||
}
|
||||
err = wsjson.Write(ctx, user.WsConn, jsonMsg)
|
||||
err := wsjson.Write(ctx, user.WsConn, message)
|
||||
if err != nil {
|
||||
log.Printf("json write error: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user