Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect documentation for Override* methods #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ func (c *Client) LogEvent(event Event) {
})
}

// Override the value of a Feature Gate for the given user
// Override the value of a Feature Gate for all users
func (c *Client) OverrideGate(gate string, val bool) {
c.errorBoundary.captureVoid(func() { c.evaluator.OverrideGate(gate, val) })
}

// Override the DynamicConfig value for the given user
// Override the DynamicConfig value for all users
func (c *Client) OverrideConfig(config string, val map[string]interface{}) {
c.errorBoundary.captureVoid(func() { c.evaluator.OverrideConfig(config, val) })
}

// Override the Layer value for the given user
// Override the Layer value for all users
func (c *Client) OverrideLayer(layer string, val map[string]interface{}) {
c.errorBoundary.captureVoid(func() { c.evaluator.OverrideLayer(layer, val) })
}
Expand Down
6 changes: 3 additions & 3 deletions evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,21 @@ func (e *evaluator) getLayerOverrideEval(name string) (*evalResult, bool) {
return &evalResult{}, false
}

// Override the value of a Feature Gate for the given user
// Override the value of a Feature Gate for all users
func (e *evaluator) OverrideGate(gate string, val bool) {
e.mu.Lock()
defer e.mu.Unlock()
e.gateOverrides[gate] = val
}

// Override the DynamicConfig value for the given user
// Override the DynamicConfig value for all users
func (e *evaluator) OverrideConfig(config string, val map[string]interface{}) {
e.mu.Lock()
defer e.mu.Unlock()
e.configOverrides[config] = val
}

// Override the Layer value for the given user
// Override the Layer value for all users
func (e *evaluator) OverrideLayer(layer string, val map[string]interface{}) {
e.mu.Lock()
defer e.mu.Unlock()
Expand Down
6 changes: 3 additions & 3 deletions statsig.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,23 +182,23 @@ func ManuallyLogConfigExposure(user User, config string) {
instance.ManuallyLogConfigExposure(user, config)
}

// Override the value of a Feature Gate for the given user
// Override the value of a Feature Gate for all users
func OverrideGate(gate string, val bool) {
if !IsInitialized() {
panic(fmt.Errorf("must Initialize() statsig before calling OverrideGate"))
}
instance.OverrideGate(gate, val)
}

// Override the DynamicConfig value for the given user
// Override the DynamicConfig value for all users
func OverrideConfig(config string, val map[string]interface{}) {
if !IsInitialized() {
panic(fmt.Errorf("must Initialize() statsig before calling OverrideConfig"))
}
instance.OverrideConfig(config, val)
}

// Override the Layer value for the given user
// Override the Layer value for all users
func OverrideLayer(layer string, val map[string]interface{}) {
if !IsInitialized() {
panic(fmt.Errorf("must Initialize() statsig before calling OverrideLayer"))
Expand Down