v1.3.0 - Adds overrideGate and overrideConfig APIs, improves ID list implementation
Introduces overrides, which are useful for testing.
func OverrideGate(gate string, val bool)
func OverrideConfig(config string, val map[string]interface{})
We recommend using this, in combination with the LocalMode
option in StatsigOptions
to force gate/config values in test environments and remove network access to statsig servers.
e.g.
c := NewClientWithOptions(secret, &Options{LocalMode: true})
user := User{
UserID: "123",
}
gateDefault := c.CheckGate(user, "any_gate")
// "any_gate" is false by default
c.OverrideGate("any_gate", true)
// "any_gate" is now true
Also introduces a more performant ID list implementation