소스 검색

fix session key unexported

vcptr 6 년 전
부모
커밋
afd805c7ba
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      common/session/context.go

+ 3 - 3
common/session/context.go

@@ -9,7 +9,7 @@ const (
 	inboundSessionKey
 	inboundSessionKey
 	outboundSessionKey
 	outboundSessionKey
 	contentSessionKey
 	contentSessionKey
-	MuxPreferedSessionKey
+	muxPreferedSessionKey
 )
 )
 
 
 // ContextWithID returns a new context with the given ID.
 // ContextWithID returns a new context with the given ID.
@@ -60,12 +60,12 @@ func ContentFromContext(ctx context.Context) *Content {
 
 
 // ContextWithMuxPrefered returns a new context with the given bool
 // ContextWithMuxPrefered returns a new context with the given bool
 func ContextWithMuxPrefered(ctx context.Context, forced bool) context.Context {
 func ContextWithMuxPrefered(ctx context.Context, forced bool) context.Context {
-	return context.WithValue(ctx, MuxPreferedSessionKey, forced)
+	return context.WithValue(ctx, muxPreferedSessionKey, forced)
 }
 }
 
 
 // MuxPreferedFromContext returns value in this context, or false if not contained.
 // MuxPreferedFromContext returns value in this context, or false if not contained.
 func MuxPreferedFromContext(ctx context.Context) bool {
 func MuxPreferedFromContext(ctx context.Context) bool {
-	if val, ok := ctx.Value(MuxPreferedSessionKey).(bool); ok {
+	if val, ok := ctx.Value(muxPreferedSessionKey).(bool); ok {
 		return val
 		return val
 	}
 	}
 	return false
 	return false