Skip to content

Commit

Permalink
docs: Small cleanups and documentation (#38)
Browse files Browse the repository at this point in the history
* docs: Add Confidence link

* chore: Remove dev names from source/docs
  • Loading branch information
fabriziodemaria authored Nov 20, 2023
1 parent f59d097 commit 9c56b9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Confidence OpenFeature Go Provider

This repo contains the OpenFeature Go flag provider for Confidence.
This repo contains the OpenFeature Go flag provider for [Confidence](https://confidence.spotify.com/).

## OpenFeature

Expand Down Expand Up @@ -55,7 +55,7 @@ client := openfeature.NewClient("testApp")
attributes := make(map[string]interface{})
attributes["country"] = "SE"
attributes["plan"] = "premium"
attributes["user_id"] = "dennis"
attributes["user_id"] = "user1"

boolValue, error := client.BooleanValue(context.Background(), "test-flag.boolean-key", false,
openfeature.NewEvaluationContext("", attributes))
Expand Down
22 changes: 11 additions & 11 deletions pkg/provider/provider_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestResolveBoolValue(t *testing.T) {

evalDetails, _ := client.BooleanValueDetails(
context.Background(), "test-flag.boolean-key", false, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, true, evalDetails.Value)
Expand All @@ -43,7 +43,7 @@ func TestResolveIntValue(t *testing.T) {

evalDetails, _ := client.IntValueDetails(
context.Background(), "test-flag.integer-key", 99, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, int64(40), evalDetails.Value)
Expand All @@ -55,7 +55,7 @@ func TestResolveDoubleValue(t *testing.T) {

evalDetails, _ := client.FloatValueDetails(
context.Background(), "test-flag.double-key", 99.99, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, 20.203, evalDetails.Value)
Expand All @@ -67,7 +67,7 @@ func TestResolveStringValue(t *testing.T) {

evalDetails, _ := client.StringValueDetails(
context.Background(), "test-flag.string-key", "default", openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, "treatment", evalDetails.Value)
Expand All @@ -79,7 +79,7 @@ func TestResolveObjectValue(t *testing.T) {

evalDetails, _ := client.ObjectValueDetails(
context.Background(), "test-flag.struct-key", "default", openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

_, ok := evalDetails.Value.(map[string]interface{})
Expand All @@ -92,7 +92,7 @@ func TestResolveNestedValue(t *testing.T) {

evalDetails, _ := client.BooleanValueDetails(
context.Background(), "test-flag.struct-key.boolean-key", true, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, false, evalDetails.Value)
Expand All @@ -104,7 +104,7 @@ func TestResolveWholeFlagAsObject(t *testing.T) {

evalDetails, _ := client.ObjectValueDetails(
context.Background(), "test-flag", "default", openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

_, ok := evalDetails.Value.(map[string]interface{})
Expand All @@ -117,7 +117,7 @@ func TestResolveWholeFlagAsObjectWithInts(t *testing.T) {

evalDetails, _ := client.ObjectValueDetails(
context.Background(), "test-flag", "default", openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

value, _ := evalDetails.Value.(map[string]interface{})
Expand All @@ -138,7 +138,7 @@ func TestResolveWithWrongType(t *testing.T) {

evalDetails, _ := client.BooleanValueDetails(
context.Background(), "test-flag.integer-key", false, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, false, evalDetails.Value)
Expand All @@ -152,7 +152,7 @@ func TestResolveWithUnexpectedFlag(t *testing.T) {

evalDetails, _ := client.BooleanValueDetails(
context.Background(), "test-flag.boolean-key", true, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, true, evalDetails.Value)
Expand All @@ -167,7 +167,7 @@ func TestResolveWithNonExistingFlag(t *testing.T) {

evalDetails, _ := client.BooleanValueDetails(
context.Background(), "test-flag.boolean-key", true, openfeature.NewEvaluationContext(
"dennis",
"user1",
attributes))

assert.Equal(t, true, evalDetails.Value)
Expand Down

0 comments on commit 9c56b9f

Please sign in to comment.