Browse Source

It doesn't make sense to return unprocess receiveval

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

7
nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

@ -22,7 +22,8 @@ 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, receiveval interface{}) {
func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interface{}) interface{}) (err error, sendval interface{}) {
var receiveval interface{}
err = nil
//Receive
@ -31,7 +32,9 @@ func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interfa
return
}
if dosth != nil {
receiveval = dosth(receiveval)
sendval = dosth(receiveval)
} else {
sendval = nil //It doesn't make sense to return unprocess receiveval
}
//Send

Loading…
Cancel
Save