Skip to content

2.0.0

Compare
Choose a tag to compare
@LaunchDarklyCI LaunchDarklyCI released this 18 Sep 22:55
· 21 commits to v2 since this release

[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 of go-server-sdk.
  • Package ldlogtest, containing test helpers for use with ldlog.
  • Package ldreason, containing EvaluationReason and related types that were formerly in go-server-sdk.
  • Package ldtime, containing UnixMillisecondTime.
  • Package lduser, containing User and related types that were formerly in go-server-sdk.
  • Package jsonstream, a fast JSON encoding tool that is used internally by the SDK.
  • ldvalue.OptionalString now implements encoding.TextMarshaler and encoding.TextUnmarshaler. This is not used by the Go SDK, but can be helpful when using OptionalString in other contexts.
  • ldvalue.OptionalBool and ldvalue.OptionalInt are analogous to ldvalue.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 or interface{} internally, decreasing the need for heap allocations.
  • Reading a User from JSON with json.Unmarshal now returns an error if the key property is missing or null.
  • EvaluationDetail.VariationIndex is now an OptionalInt rather than an int.
  • 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 existing interface{} value in a Value.
  • All deprecated members of types that were moved here from go-server-sdk have been removed.