Skip to content

Commit 3269cf3

Browse files
author
IsaacDSC
committed
Enhance feature flag examples and clean up test files
- Add retrieval examples for feature flags "teste3" with valid and invalid session IDs in both FEATURE_FLAG.md and main.go. - Remove unnecessary blank lines in contenthub_dto_test.go and featureflag_dto_test.go for cleaner code.
1 parent b38cc7a commit 3269cf3

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

docs/FEATURE_FLAG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,17 @@ func main() {
8484
test1, err := ff.GetFeatureFlag("teste1").Err()
8585
fmt.Println("@@@ teste1: ", test1, err)
8686

87+
test3, err := ff.GetFeatureFlag("teste3", "34eec623-c9f2-494e-bf66-57a85139fd69").Err()
88+
fmt.Println("@@@ teste3: ", test3, err)
89+
90+
test4, err := ff.GetFeatureFlag("teste3", "not-found-session-id").Err()
91+
fmt.Println("@@@ teste4: ", test4, err)
92+
8793
w.WriteHeader(http.StatusOK)
8894
})
8995

9096
if err := http.ListenAndServe(":8080", nil); err != nil {
9197
panic(err)
9298
}
9399
}
94-
95100
```

example/featureflag/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ func main() {
3636
test1, err := ff.GetFeatureFlag("teste1").Err()
3737
fmt.Println("@@@ teste1: ", test1, err)
3838

39+
test3, err := ff.GetFeatureFlag("teste3", "34eec623-c9f2-494e-bf66-57a85139fd69").Err()
40+
fmt.Println("@@@ teste3: ", test3, err)
41+
42+
test4, err := ff.GetFeatureFlag("teste3", "not-found-session-id").Err()
43+
fmt.Println("@@@ teste4: ", test4, err)
44+
3945
w.WriteHeader(http.StatusOK)
4046
})
4147

internal/contenthub/contenthub_dto_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,5 +393,3 @@ func TestFromDomain_PreservesAllFields(t *testing.T) {
393393
t.Error("CreatedAt not properly preserved")
394394
}
395395
}
396-
397-

internal/featureflag/featureflag_dto_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,3 @@ func TestDtoFromDomain(t *testing.T) {
266266
})
267267
}
268268
}
269-

0 commit comments

Comments
 (0)