yjp 5 ヶ月 前
コミット
343fddd23d
1 ファイル変更2 行追加2 行削除
  1. 2 2
      websocket/websocket.go

+ 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
 	}
 }