Skip to content

Commit

Permalink
fix session key unexported
Browse files Browse the repository at this point in the history
  • Loading branch information
vcptr committed Nov 26, 2019
1 parent 59e3a2a commit afd805c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/session/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const (
inboundSessionKey
outboundSessionKey
contentSessionKey
MuxPreferedSessionKey
muxPreferedSessionKey
)

// ContextWithID returns a new context with the given ID.
Expand Down Expand Up @@ -60,12 +60,12 @@ func ContentFromContext(ctx context.Context) *Content {

// ContextWithMuxPrefered returns a new context with the given bool
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.
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 false
Expand Down

0 comments on commit afd805c

Please sign in to comment.