Releases: statsig-io/go-sdk
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
v1.1.0 - customIDs for experiments, and localMode
Added support for customIDs in the user object: another identifier for a user (e.g. companyID, groupID, etc.) that you wish to experiment on
Added option localMode: boolean
. When set to true, it disables all network requests to the server, and the SDK simply returns default values as a result. Addresses issue - #6
Internal SDK improvements
There is none functionality change in this release.
- corrected typing for one of the parameters in the request to download rule sets so it aligns with other SDKs
- removed wrapper SDK that was used for the Python SDK, which is now all written in Python natively.