open-feature / go-sdk

Go SDK for OpenFeature
https://openfeature.dev
Apache License 2.0
144 stars 33 forks source link

feat: EvaluationContext add constructor without TargetingKey #204

Closed thomaspoignant closed 1 year ago

thomaspoignant commented 1 year ago

This PR

Based on this discussion we have discovered that in some cases we want to create an EvaluationContext without Targeting key.

WithNewEvaluationContext it was mandatory to set a targetingKey forcing us to set an empty targetingKey sometimes.

In this PR we add a new constructor called NewTargetlessEvaluationContext that is doing exactly the same things as NewEvaluationContext but does not force you to add a targetingKey.

codecov[bot] commented 1 year ago

Codecov Report

Merging #204 (40ffb01) into main (a2987b8) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
+ Coverage   78.95%   78.99%   +0.03%     
==========================================
  Files           9        9              
  Lines        1074     1076       +2     
==========================================
+ Hits          848      850       +2     
  Misses        204      204              
  Partials       22       22              
Files Changed Coverage Δ
pkg/openfeature/evaluation_context.go 82.60% <100.00%> (+1.65%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more