|
|
@ -22,8 +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, sendval interface{}) { |
|
|
|
var receiveval interface{} |
|
|
|
func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interface{}) interface{}) (err error, receiveval interface{}) { |
|
|
|
var sendval interface{} |
|
|
|
err = nil |
|
|
|
|
|
|
|
//Receive
|
|
|
@ -38,7 +38,7 @@ func WsjsonReceive(ctx context.Context, conn *websocket.Conn, dosth func(interfa |
|
|
|
} |
|
|
|
|
|
|
|
//Send
|
|
|
|
err = wsjson.Write(ctx, conn, receiveval.(string)) |
|
|
|
err = wsjson.Write(ctx, conn, sendval.(string)) |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|