* replace interface{} with any
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-07-05 09:46:50 +03:00
коммит произвёл GitHub
родитель b45ff0be5d
Коммит 717a4d04a9
258 изменённых файлов: 1286 добавлений и 1286 удалений

Просмотреть файл

@@ -32,7 +32,7 @@ const (
type writeMessage struct {
msgType msgType
data interface{}
data any
}
const avgReadMsgSizeBytes = 1024
@@ -111,7 +111,7 @@ func makeClient(dialer *websocket.Dialer, url, connectURL, authToken string, hea
client.configurePingHandling()
go client.writer()
client.SendMessage(WebsocketAuthenticationChallenge, map[string]interface{}{"token": authToken})
client.SendMessage(WebsocketAuthenticationChallenge, map[string]any{"token": authToken})
return client, nil
}
@@ -157,7 +157,7 @@ func (wsc *WebSocketClient) ConnectWithDialer(dialer *websocket.Dialer) *AppErro
wsc.EventChannel = make(chan *WebSocketEvent, 100)
wsc.ResponseChannel = make(chan *WebSocketResponse, 100)
wsc.SendMessage(WebsocketAuthenticationChallenge, map[string]interface{}{"token": wsc.AuthToken})
wsc.SendMessage(WebsocketAuthenticationChallenge, map[string]any{"token": wsc.AuthToken})
return nil
}
@@ -268,7 +268,7 @@ func (wsc *WebSocketClient) Listen() {
}()
}
func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{}) {
func (wsc *WebSocketClient) SendMessage(action string, data map[string]any) {
req := &WebSocketRequest{}
req.Seq = wsc.Sequence
req.Action = action
@@ -281,7 +281,7 @@ func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface
}
}
func (wsc *WebSocketClient) SendBinaryMessage(action string, data map[string]interface{}) error {
func (wsc *WebSocketClient) SendBinaryMessage(action string, data map[string]any) error {
req := &WebSocketRequest{}
req.Seq = wsc.Sequence
req.Action = action
@@ -304,7 +304,7 @@ func (wsc *WebSocketClient) SendBinaryMessage(action string, data map[string]int
// UserTyping will push a user_typing event out to all connected users
// who are in the specified channel
func (wsc *WebSocketClient) UserTyping(channelId, parentId string) {
data := map[string]interface{}{
data := map[string]any{
"channel_id": channelId,
"parent_id": parentId,
}
@@ -320,7 +320,7 @@ func (wsc *WebSocketClient) GetStatuses() {
// GetStatusesByIds will fetch certain user statuses based on ids and return
// a map of string statuses using user id as the key
func (wsc *WebSocketClient) GetStatusesByIds(userIds []string) {
data := map[string]interface{}{
data := map[string]any{
"user_ids": userIds,
}
wsc.SendMessage("get_statuses_by_ids", data)