You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling a variation (e.g., ffclient.BoolVariation("test", ffUser, false) without first calling ffclient.Init(), a panic happens due to a nil pointer dereference.
This is happening due to directly referencing ff here:
I expect the variation call to return an error, and set the return value to the default specified in the call. This behaviour is expected based on the existing documentation, both in function docs:
Observed behavior
When calling a variation (e.g.,
ffclient.BoolVariation("test", ffUser, false
) without first callingffclient.Init()
, a panic happens due to a nil pointer dereference.This is happening due to directly referencing
ff
here:go-feature-flag/variation.go
Lines 22 to 27 in d6dd663
where
ff
is a pointer type:go-feature-flag/feature_flag.go
Line 49 in d6dd663
that is only set when calling
Init()
:go-feature-flag/feature_flag.go
Lines 26 to 32 in d6dd663
Expected Behavior
I expect the variation call to return an error, and set the return value to the default specified in the call. This behaviour is expected based on the existing documentation, both in function docs:
go-feature-flag/variation.go
Lines 22 to 25 in d6dd663
and in the documentation site:
go-feature-flag/docs/users.md
Line 70 in d6dd663
I do not expect a panic/nil pointer dereference.
Steps to reproduce
Results in:
The text was updated successfully, but these errors were encountered: