Skip to content

Commit

Permalink
Docs: add notes about FeatureEnabled to function docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Dec 19, 2023
1 parent bc87bd3 commit 12e10a4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ type VariantOption func(*variantOption)
// variant is not found on the unleash service. This could be because
// the feature doesn't exist, because it is disabled, or because it
// has no variants.
//
// If you specify a fallback variant, note that its `FeatureEnabled`
// field will be set to whatever you pass in or `false` by default. In
// other words, it will not reflect the feature's actual enabled
// state.
func WithVariantFallback(variantFallback *api.Variant) VariantOption {
return func(opts *variantOption) {
opts.variantFallback = variantFallback
Expand All @@ -228,6 +233,11 @@ func WithVariantFallback(variantFallback *api.Variant) VariantOption {
// to a variant when a variant is not found for a feature. This could
// be because the feature doesn't exist, because it is disabled, or
// because it has no variants.
//
// If you specify a fallback variant, note that its `FeatureEnabled`
// field will be set to whatever you pass in or `false` by default. In
// other words, it will not reflect the feature's actual enabled
// state.
func WithVariantFallbackFunc(variantFallbackFunc VariantFallbackFunc) VariantOption {
return func(opts *variantOption) {
opts.variantFallbackFunc = variantFallbackFunc
Expand Down

0 comments on commit 12e10a4

Please sign in to comment.