diff --git a/client.go b/client.go index 4e61d20..36b75f4 100644 --- a/client.go +++ b/client.go @@ -313,7 +313,7 @@ type getConfigInput struct { func (c *Client) checkGateImpl(user User, name string, options checkGateOptions) FeatureGate { return c.errorBoundary.captureCheckGate(func() FeatureGate { if !c.verifyUser(user) { - return *NewGate(name, false, "", "") + return *NewGate(name, false, "", "", nil) } user = normalizeUser(user, *c.options) res := c.evaluator.evalGate(user, name) @@ -330,7 +330,7 @@ func (c *Client) checkGateImpl(user User, name string, options checkGateOptions) c.options.EvaluationCallbacks.GateEvaluationCallback(name, res.Value, exposure) } } - return *NewGate(name, res.Value, res.RuleID, res.GroupName) + return *NewGate(name, res.Value, res.RuleID, res.GroupName, res.EvaluationDetails) }) } diff --git a/types.go b/types.go index a00b6c4..8898c0b 100644 --- a/types.go +++ b/types.go @@ -37,10 +37,11 @@ type configBase struct { } type FeatureGate struct { - Name string `json:"name"` - Value bool `json:"value"` - RuleID string `json:"rule_id"` - GroupName string `json:"group_name"` + Name string `json:"name"` + Value bool `json:"value"` + RuleID string `json:"rule_id"` + GroupName string `json:"group_name"` + EvaluationDetails *evaluationDetails `json:"evaluation_details"` } // A json blob configured in the Statsig Console @@ -54,12 +55,13 @@ type Layer struct { AllocatedExperimentName string `json:"allocated_experiment_name"` } -func NewGate(name string, value bool, ruleID string, groupName string) *FeatureGate { +func NewGate(name string, value bool, ruleID string, groupName string, evaluationDetails *evaluationDetails) *FeatureGate { return &FeatureGate{ - Name: name, - Value: value, - RuleID: ruleID, - GroupName: groupName, + Name: name, + Value: value, + RuleID: ruleID, + GroupName: groupName, + EvaluationDetails: evaluationDetails, } }