Unleash / unleash-client-go

Unleash client SDK for Go
https://docs.getunleash.io
Apache License 2.0
138 stars 55 forks source link

Feat/global segments #116

Closed FredrikOseberg closed 2 years ago

FredrikOseberg commented 2 years ago

This PR will implement global segments as a part of performance optimizations related to segment use. This will ensure that segments are sent as part of the payload from the client API, parsed correctly into a map on the SDK side and combined with the regular strategy constraints.

Fixes #115

FredrikOseberg commented 2 years ago

Looks good to me! I've left a text change comment, aside from that, this is great!

Just a quick double check because my Golang isn't strong - this should still parse responses from the API when the segments property isn't set?

Edit: Just saw this work with empty responses, great!

I added a test for testing the old response with the new interface:

https://github.com/Unleash/unleash-client-go/pull/116/commits/243af78842d9e22720a27e512ab779cc2a879e20