@@ -30,7 +30,7 @@ func (i InMemoryProvider) Metadata() openfeature.Metadata {
3030 }
3131}
3232
33- func (i InMemoryProvider ) BooleanEvaluation (ctx context.Context , flag string , defaultValue bool , evalCtx openfeature.FlattenedContext ) openfeature.BoolResolutionDetail {
33+ func (i InMemoryProvider ) BooleanEvaluation (ctx context.Context , flag string , defaultValue bool , flatCtx openfeature.FlattenedContext ) openfeature.BoolResolutionDetail {
3434 memoryFlag , details , ok := i .find (flag )
3535 if ! ok {
3636 return openfeature.BoolResolutionDetail {
@@ -39,7 +39,7 @@ func (i InMemoryProvider) BooleanEvaluation(ctx context.Context, flag string, de
3939 }
4040 }
4141
42- resolveFlag , detail := memoryFlag .Resolve (defaultValue , evalCtx )
42+ resolveFlag , detail := memoryFlag .Resolve (defaultValue , flatCtx )
4343 result := genericResolve [bool ](resolveFlag , defaultValue , & detail )
4444
4545 return openfeature.BoolResolutionDetail {
@@ -48,7 +48,7 @@ func (i InMemoryProvider) BooleanEvaluation(ctx context.Context, flag string, de
4848 }
4949}
5050
51- func (i InMemoryProvider ) StringEvaluation (ctx context.Context , flag string , defaultValue string , evalCtx openfeature.FlattenedContext ) openfeature.StringResolutionDetail {
51+ func (i InMemoryProvider ) StringEvaluation (ctx context.Context , flag string , defaultValue string , flatCtx openfeature.FlattenedContext ) openfeature.StringResolutionDetail {
5252 memoryFlag , details , ok := i .find (flag )
5353 if ! ok {
5454 return openfeature.StringResolutionDetail {
@@ -57,7 +57,7 @@ func (i InMemoryProvider) StringEvaluation(ctx context.Context, flag string, def
5757 }
5858 }
5959
60- resolveFlag , detail := memoryFlag .Resolve (defaultValue , evalCtx )
60+ resolveFlag , detail := memoryFlag .Resolve (defaultValue , flatCtx )
6161 result := genericResolve [string ](resolveFlag , defaultValue , & detail )
6262
6363 return openfeature.StringResolutionDetail {
@@ -66,7 +66,7 @@ func (i InMemoryProvider) StringEvaluation(ctx context.Context, flag string, def
6666 }
6767}
6868
69- func (i InMemoryProvider ) FloatEvaluation (ctx context.Context , flag string , defaultValue float64 , evalCtx openfeature.FlattenedContext ) openfeature.FloatResolutionDetail {
69+ func (i InMemoryProvider ) FloatEvaluation (ctx context.Context , flag string , defaultValue float64 , flatCtx openfeature.FlattenedContext ) openfeature.FloatResolutionDetail {
7070 memoryFlag , details , ok := i .find (flag )
7171 if ! ok {
7272 return openfeature.FloatResolutionDetail {
@@ -75,7 +75,7 @@ func (i InMemoryProvider) FloatEvaluation(ctx context.Context, flag string, defa
7575 }
7676 }
7777
78- resolveFlag , detail := memoryFlag .Resolve (defaultValue , evalCtx )
78+ resolveFlag , detail := memoryFlag .Resolve (defaultValue , flatCtx )
7979 result := genericResolve [float64 ](resolveFlag , defaultValue , & detail )
8080
8181 return openfeature.FloatResolutionDetail {
@@ -84,7 +84,7 @@ func (i InMemoryProvider) FloatEvaluation(ctx context.Context, flag string, defa
8484 }
8585}
8686
87- func (i InMemoryProvider ) IntEvaluation (ctx context.Context , flag string , defaultValue int64 , evalCtx openfeature.FlattenedContext ) openfeature.IntResolutionDetail {
87+ func (i InMemoryProvider ) IntEvaluation (ctx context.Context , flag string , defaultValue int64 , flatCtx openfeature.FlattenedContext ) openfeature.IntResolutionDetail {
8888 memoryFlag , details , ok := i .find (flag )
8989 if ! ok {
9090 return openfeature.IntResolutionDetail {
@@ -93,7 +93,7 @@ func (i InMemoryProvider) IntEvaluation(ctx context.Context, flag string, defaul
9393 }
9494 }
9595
96- resolveFlag , detail := memoryFlag .Resolve (defaultValue , evalCtx )
96+ resolveFlag , detail := memoryFlag .Resolve (defaultValue , flatCtx )
9797 result := genericResolve [int ](resolveFlag , int (defaultValue ), & detail )
9898
9999 return openfeature.IntResolutionDetail {
@@ -102,7 +102,7 @@ func (i InMemoryProvider) IntEvaluation(ctx context.Context, flag string, defaul
102102 }
103103}
104104
105- func (i InMemoryProvider ) ObjectEvaluation (ctx context.Context , flag string , defaultValue any , evalCtx openfeature.FlattenedContext ) openfeature.InterfaceResolutionDetail {
105+ func (i InMemoryProvider ) ObjectEvaluation (ctx context.Context , flag string , defaultValue any , flatCtx openfeature.FlattenedContext ) openfeature.InterfaceResolutionDetail {
106106 memoryFlag , details , ok := i .find (flag )
107107 if ! ok {
108108 return openfeature.InterfaceResolutionDetail {
@@ -111,7 +111,7 @@ func (i InMemoryProvider) ObjectEvaluation(ctx context.Context, flag string, def
111111 }
112112 }
113113
114- resolveFlag , detail := memoryFlag .Resolve (defaultValue , evalCtx )
114+ resolveFlag , detail := memoryFlag .Resolve (defaultValue , flatCtx )
115115
116116 var result any
117117 if resolveFlag != nil {
@@ -175,7 +175,7 @@ type State string
175175
176176// ContextEvaluator is a callback to perform openfeature.EvaluationContext backed evaluations.
177177// This is a callback implemented by the flag definer.
178- type ContextEvaluator * func (this InMemoryFlag , evalCtx openfeature.FlattenedContext ) (any , openfeature.ProviderResolutionDetail )
178+ type ContextEvaluator * func (this InMemoryFlag , flatCtx openfeature.FlattenedContext ) (any , openfeature.ProviderResolutionDetail )
179179
180180// InMemoryFlag is the feature flag representation accepted by InMemoryProvider
181181type InMemoryFlag struct {
@@ -186,9 +186,9 @@ type InMemoryFlag struct {
186186 ContextEvaluator ContextEvaluator
187187}
188188
189- func (flag * InMemoryFlag ) Resolve (defaultValue any , evalCtx openfeature.FlattenedContext ) (
190- any , openfeature.ProviderResolutionDetail ) {
191-
189+ func (flag * InMemoryFlag ) Resolve (defaultValue any , flatCtx openfeature.FlattenedContext ) (
190+ any , openfeature.ProviderResolutionDetail ,
191+ ) {
192192 // check the state
193193 if flag .State == Disabled {
194194 return defaultValue , openfeature.ProviderResolutionDetail {
@@ -199,7 +199,7 @@ func (flag *InMemoryFlag) Resolve(defaultValue any, evalCtx openfeature.Flattene
199199
200200 // first resolve from context callback
201201 if flag .ContextEvaluator != nil {
202- return (* flag .ContextEvaluator )(* flag , evalCtx )
202+ return (* flag .ContextEvaluator )(* flag , flatCtx )
203203 }
204204
205205 // fallback to evaluation
0 commit comments