Releases: statsig-io/go-sdk
v1.5.1 - make shutdown thread safe and linter fixes
- made
shutdown()
not clear the shared instance so that it's thread safe; - fixed a few linter issues in the SDK
v1.5.0 - concurrency support
- in this release we added a few tests where the SDK is being used concurrently from multiple goroutines, enabled race detector on all tests, and fixed code and tests that were broken before.
- added a
getMap()
API on DynamicConfig and Layer
v1.4.2 - bug fixes
2 bug fixes:
- infinite tail recursions in store class
- shutdown might be delayed for a few seconds due to a data race
Thanks @sbunce for the suggestions!
v1.4.1 - bug fix
Fixed a data race in normalizeUser
function
v1.4.0 - Layers API and fixes
- introduced a new API
getLayer
, see docs.statsig.com/layers for details - fixed a deadlock bug in logger
v1.3.1 - Fixes race condition in the logger
The logger has a single queue of events being accessed from multiple threads. This patch fixes a race condition in the logger
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
v1.2.1 - fix eq/neq operator when the target value is null
We added a new condition to match when a value on the user "is null" and "is not null". Due to how golang works, a string field on user, like email
will never be nil, but will be an empty string instead. This patch makes it so that empty string on a user field is treated the same as nil.
v1.2.0 - adds support for ID Lists and LogImmediate API
In this release the SDK now has 2 new features:
- it can now evaluate rules that are based on ID lists. ID lists are powerful dynamic lists that can be modified and checked on the fly. See here on how to use it.
- added a new API
LogImmediate(events []Event) (*http.Response, error)
, which makes it convenient for you to send an array of events directly to our server right away, and returns the standard http response and error that httpClient returns. Note that the max number of events it takes is 500.
statsig.Initialize("secret-key")
response, err := statsig.LogImmediate(events)
if err != nil {
// handle error
}
// also check response.StatusCode and do things like retry if needed
v1.1.1 - Patch vulnerability in ua parser
This vulnerability was fixed as part of ua-parser/uap-go#73 (commit: ua-parser/uap-go@3b2ceb1).
This version has the updated and fixed 'ua-parser' dependency