Releases: launchdarkly/go-sdk-common
Releases · launchdarkly/go-sdk-common
2.2.3
2.2.2
[2.2.2] - 2021-01-15
Changed:
- Greatly improved the efficiency of deserializing
lduser
andldvalue
types from JSON when thelaunchdarkly_easyjson
build tag is enabled, by using the EasyJSON API more directly than before. When the build tag is not enabled, these changes have no effect.
2.2.1
[2.2.1] - 2021-01-04
Fixed:
- Parsing a
User
from JSON failed if there was aprivateAttributeNames
property whose value wasnull
. This has been fixed so that it behaves the same as if the property had a value of[]
or if it was not present at all.
2.2.0
[2.2.0] - 2020-12-17
Added:
- All types that can be converted to or from JSON now have
WriteToJSONWriter
andReadFromJSONReader
methods that use the newgo-jsonstream
API for greater efficiency, althoughjson.Marshal
andjson.Unmarshal
still also work.
Deprecated:
- The
jsonstream
subpackage ingo-sdk-common
is now deprecated in favor ofgo-jsonstream
. The Go SDK no longer usesjsonstream
, but it is retained here for backward compatibility with any other code that may have been using it. Some types still haveWriteToJSONBuffer
methods for usingjsonstream
; these are also deprecated.
2.1.0
[2.1.0] - 2020-12-14
Added:
IsDefined()
method forldvalue.Value
,ldreason.EvaluationReason
, andldtime.UnixMillisecondTime
.ValueArray
andValueMap
types inldvalue
, for representing immutable JSON array/object data in contexts where only an array or an object is allowed, as opposed to the more generalldvalue.Value
. This is mainly used by LaunchDarkly internal components but may be useful elsewhere.
Changed:
- In
lduser.NewUserBuilderFromUser()
, if the original user had custom attributes and/or private attributes, the map that holds that data now has copy-on-write behavior: that is, the builder will only allocate a new map if you actually make changes to those attributes.
2.0.1
[2.0.1] - 2020-10-08
Fixed:
- Trying to unmarshal a JSON
null
value intolduser.User
now returns an error of type*json.UnmarshalTypeError
, rather than misleadingly returninglduser.ErrMissingKey()
. - Trying to unmarshal a JSON value of the wrong type into
ldvalue.OptionalBool
,ldvalue.OptionalInt
, orldvalue.OptionalString
now returns an error of type*json.UnmarshalTypeError
, rather than a generic error string fromerrors.New()
. - The error
lduser.ErrMissingKey()
had an empty error string.
2.0.0
[2.0.0] - 2020-09-18
Initial release of the newer types that will be used in Go SDK 5.0 and above.
Added:
- Package
ldlog
, which was formerly a subpackage ofgo-server-sdk
. - Package
ldlogtest
, containing test helpers for use withldlog
. - Package
ldreason
, containingEvaluationReason
and related types that were formerly ingo-server-sdk
. - Package
ldtime
, containingUnixMillisecondTime
. - Package
lduser
, containingUser
and related types that were formerly ingo-server-sdk
. - Package
jsonstream
, a fast JSON encoding tool that is used internally by the SDK. ldvalue.OptionalString
now implementsencoding.TextMarshaler
andencoding.TextUnmarshaler
. This is not used by the Go SDK, but can be helpful when usingOptionalString
in other contexts.ldvalue.OptionalBool
andldvalue.OptionalInt
are analogous toldvalue.OptionalString
, representing values that may be undefined without using pointers. These are used in the Go SDK.
Changed:
- The minimum Go version is now 1.14.
- The
User
type is now opaque and immutable; there is no direct access to its fields. - The
User
type no longer uses pointers orinterface{}
internally, decreasing the need for heap allocations. - Reading a
User
from JSON withjson.Unmarshal
now returns an error if thekey
property is missing or null. EvaluationDetail.VariationIndex
is now anOptionalInt
rather than anint
.EvaluationReason
is now a struct.- This project is now a Go module, although it can still be used from non-module code.
Removed:
- In
ldvalue
, there are no longer methods for wrapping an existinginterface{}
value in aValue
. - All deprecated members of types that were moved here from
go-server-sdk
have been removed.
1.0.0
[1.0.0] - 2020-02-03
Initial release. This will be used in versions 4.16.0 and above of the LaunchDarkly Server-Side SDK for Go.