Skip to content

Commit

Permalink
docs(GOFF): Fix issues in readme (#814)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Signed-off-by: Daniel Zehetner <daniel.zehetner@dynatrace.com>
  • Loading branch information
thomaspoignant authored and zedadyna committed Jun 11, 2024
1 parent 101a00c commit 6eaa321
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions providers/go-feature-flag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ FeatureProvider provider = new GoFeatureFlagProvider(
.timeout(1000)
.build());

OpenFeatureAPI.getInstance().setProviderAndWait(providerName);
OpenFeatureAPI.getInstance().setProviderAndWait(provider);

// ...

Client client = OpenFeatureAPI.getInstance().getClient(providerName);
Client client = OpenFeatureAPI.getInstance().getClient("my-provider");

// targetingKey is mandatory for each evaluation
String targetingKey = "ad0c6f75-f5d6-4b17-b8eb-6c923d8d4698";
EvaluationContext evaluationContext = new ImmutableContext(targetingKey);

booleanFlagEvaluationDetails = client.getBooleanDetails("feature_flag1", false, evaluationContext);
value = booleanFlagEvaluationDetails.getValue();
FlagEvaluationDetails<Boolean> booleanFlagEvaluationDetails = client.getBooleanDetails("feature_flag1", false, evaluationContext);
Boolean value = booleanFlagEvaluationDetails.getValue();

// ...

Expand Down

0 comments on commit 6eaa321

Please sign in to comment.