Browse Source

sendbval benötigt es bei WsjsonReceive gar nict

test
Klaus Wendel 2 years ago
parent
commit
b1605a737d
  1. 7
      nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

7
nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

@ -22,8 +22,7 @@ func WsjsonSend(ctx context.Context, conn *websocket.Conn, sendval interface{})
return nil, receiveval
}
func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interface{}) interface{}) (err error, sendval interface{}) {
var receiveval interface{}
func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interface{}) interface{}) (err error, receiveval interface{}) {
err = nil
//Receive
@ -32,9 +31,7 @@ func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interfa
return
}
if dosth != nil {
sendval = dosth(receiveval)
} else {
sendval = receiveval
receiveval = dosth(receiveval)
}
//Send

Loading…
Cancel
Save