@@ -109,7 +109,7 @@ func aBooleanFlagWithKeyIsEvaluatedWithDefaultValue(
109109 return ctx , errors .New ("default value must be of type bool" )
110110 }
111111
112- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).BooleanValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
112+ got , err := openfeature .NewClient ("evaluation-test" ).BooleanValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
113113 if err != nil {
114114 return ctx , fmt .Errorf ("openfeature client: %w" , err )
115115 }
@@ -138,7 +138,7 @@ func theResolvedBooleanValueShouldBe(ctx context.Context, expectedValueStr strin
138138func aStringFlagWithKeyIsEvaluatedWithDefaultValue (
139139 ctx context.Context , flagKey , defaultValue string ,
140140) (context.Context , error ) {
141- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).StringValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
141+ got , err := openfeature .NewClient ("evaluation-test" ).StringValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
142142 if err != nil {
143143 return ctx , fmt .Errorf ("openfeature client: %w" , err )
144144 }
@@ -162,7 +162,7 @@ func theResolvedStringValueShouldBe(ctx context.Context, expectedValue string) e
162162func anIntegerFlagWithKeyIsEvaluatedWithDefaultValue (
163163 ctx context.Context , flagKey string , defaultValue int64 ,
164164) (context.Context , error ) {
165- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).IntValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
165+ got , err := openfeature .NewClient ("evaluation-test" ).IntValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
166166 if err != nil {
167167 return ctx , fmt .Errorf ("openfeature client: %w" , err )
168168 }
@@ -186,7 +186,7 @@ func theResolvedIntegerValueShouldBe(ctx context.Context, expectedValue int64) e
186186func aFloatFlagWithKeyIsEvaluatedWithDefaultValue (
187187 ctx context.Context , flagKey string , defaultValue float64 ,
188188) (context.Context , error ) {
189- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).FloatValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
189+ got , err := openfeature .NewClient ("evaluation-test" ).FloatValue (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
190190 if err != nil {
191191 return ctx , fmt .Errorf ("openfeature client: %w" , err )
192192 }
@@ -208,7 +208,7 @@ func theResolvedFloatValueShouldBe(ctx context.Context, expectedValue float64) e
208208}
209209
210210func anObjectFlagWithKeyIsEvaluatedWithANullDefaultValue (ctx context.Context , flagKey string ) (context.Context , error ) {
211- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).ObjectValue (ctx , flagKey , nil , openfeature.EvaluationContext {})
211+ got , err := openfeature .NewClient ("evaluation-test" ).ObjectValue (ctx , flagKey , nil , openfeature.EvaluationContext {})
212212 if err != nil {
213213 return ctx , fmt .Errorf ("openfeature client: %w" , err )
214214 }
@@ -270,7 +270,7 @@ func aBooleanFlagWithKeyIsEvaluatedWithDetailsAndDefaultValue(
270270 return ctx , errors .New ("default value must be of type bool" )
271271 }
272272
273- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).BooleanValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
273+ got , err := openfeature .NewClient ("evaluation-test" ).BooleanValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
274274 if err != nil {
275275 return ctx , fmt .Errorf ("openfeature client: %w" , err )
276276 }
@@ -314,7 +314,7 @@ func theResolvedBooleanDetailsValueShouldBeTheVariantShouldBeAndTheReasonShouldB
314314func aStringFlagWithKeyIsEvaluatedWithDetailsAndDefaultValue (
315315 ctx context.Context , flagKey , defaultValue string ,
316316) (context.Context , error ) {
317- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).StringValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
317+ got , err := openfeature .NewClient ("evaluation-test" ).StringValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
318318 if err != nil {
319319 return ctx , fmt .Errorf ("openfeature client: %w" , err )
320320 }
@@ -353,7 +353,7 @@ func theResolvedStringDetailsValueShouldBeTheVariantShouldBeAndTheReasonShouldBe
353353func anIntegerFlagWithKeyIsEvaluatedWithDetailsAndDefaultValue (
354354 ctx context.Context , flagKey string , defaultValue int64 ,
355355) (context.Context , error ) {
356- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).IntValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
356+ got , err := openfeature .NewClient ("evaluation-test" ).IntValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
357357 if err != nil {
358358 return ctx , fmt .Errorf ("openfeature client: %w" , err )
359359 }
@@ -392,7 +392,7 @@ func theResolvedIntegerDetailsValueShouldBeTheVariantShouldBeAndTheReasonShouldB
392392func aFloatFlagWithKeyIsEvaluatedWithDetailsAndDefaultValue (
393393 ctx context.Context , flagKey string , defaultValue float64 ,
394394) (context.Context , error ) {
395- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).FloatValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
395+ got , err := openfeature .NewClient ("evaluation-test" ).FloatValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
396396 if err != nil {
397397 return ctx , fmt .Errorf ("openfeature client: %w" , err )
398398 }
@@ -431,7 +431,7 @@ func theResolvedFloatDetailsValueShouldBeTheVariantShouldBeAndTheReasonShouldBe(
431431func anObjectFlagWithKeyIsEvaluatedWithDetailsAndANullDefaultValue (
432432 ctx context.Context , flagKey string ,
433433) (context.Context , error ) {
434- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).ObjectValueDetails (ctx , flagKey , nil , openfeature.EvaluationContext {})
434+ got , err := openfeature .NewClient ("evaluation-test" ).ObjectValueDetails (ctx , flagKey , nil , openfeature.EvaluationContext {})
435435 if err != nil {
436436 return ctx , fmt .Errorf ("openfeature client: %w" , err )
437437 }
@@ -538,7 +538,7 @@ func aFlagWithKeyIsEvaluatedWithDefaultValue(
538538 return ctx , errors .New ("no contextAwareEvaluationData found" )
539539 }
540540
541- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).StringValue (ctx , flagKey , defaultValue , ctxAwareEvalData .evaluationContext )
541+ got , err := openfeature .NewClient ("evaluation-test" ).StringValue (ctx , flagKey , defaultValue , ctxAwareEvalData .evaluationContext )
542542 if err != nil {
543543 return ctx , fmt .Errorf ("openfeature client: %w" , err )
544544 }
@@ -568,7 +568,7 @@ func theResolvedFlagValueIsWhenTheContextIsEmpty(ctx context.Context, expectedRe
568568 return errors .New ("no contextAwareEvaluationData found" )
569569 }
570570
571- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).StringValue (
571+ got , err := openfeature .NewClient ("evaluation-test" ).StringValue (
572572 ctx , ctxAwareEvalData .flagKey , ctxAwareEvalData .defaultValue , openfeature.EvaluationContext {},
573573 )
574574 if err != nil {
@@ -585,7 +585,7 @@ func theResolvedFlagValueIsWhenTheContextIsEmpty(ctx context.Context, expectedRe
585585func aNonexistentStringFlagWithKeyIsEvaluatedWithDetailsAndADefaultValue (
586586 ctx context.Context , flagKey , defaultValue string ,
587587) (context.Context , error ) {
588- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).StringValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
588+ got , err := openfeature .NewClient ("evaluation-test" ).StringValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
589589
590590 return context .WithValue (ctx , ctxStorageKey {}, stringFlagNotFoundData {
591591 evalDetails : got ,
@@ -642,7 +642,7 @@ func theReasonShouldIndicateAnErrorAndTheErrorCodeShouldIndicateAMissingFlagWith
642642func aStringFlagWithKeyIsEvaluatedAsAnIntegerWithDetailsAndADefaultValue (
643643 ctx context.Context , flagKey string , defaultValue int64 ,
644644) (context.Context , error ) {
645- got , err := openfeature .GetApiInstance (). GetNamedClient ("evaluation-test" ).IntValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
645+ got , err := openfeature .NewClient ("evaluation-test" ).IntValueDetails (ctx , flagKey , defaultValue , openfeature.EvaluationContext {})
646646
647647 return context .WithValue (ctx , ctxStorageKey {}, typeErrorData {
648648 evalDetails : got ,
0 commit comments