yjp 5 сар өмнө
parent
commit
343fddd23d

+ 2 - 2
websocket/websocket.go

@@ -128,8 +128,8 @@ func (m *Manager) BroadCast(groupID string, msg []byte) error {
 
 type ConnectionOption func(sessionMap map[string]any)
 
-func WithConnectionContext(key string, context any) ConnectionOption {
+func WithConnectionContext(context any) ConnectionOption {
 	return func(sessionMap map[string]any) {
-		sessionMap[connectionContextKey+"::"+key] = context
+		sessionMap[connectionContextKey] = context
 	}
 }