PostHog / posthog-go

Official PostHog Go library
MIT License
20 stars 17 forks source link

featureflags: propagate groups value to getFeatureFlagVariant #15

Closed AChelikani closed 1 year ago

AChelikani commented 1 year ago

Fixes https://github.com/PostHog/posthog-go/issues/14.

The Groups value in calls to GetFeatureFlag or IsFeatureEnabled is not propagated. This manifests in not being able to fetch feature flag via. those methods by Groups.

AChelikani commented 1 year ago

@neilkakkar would you mind taking a look? I'm blocked on our feature flag rollout from the issue.

neilkakkar commented 1 year ago

Thank you!

Mind adding a test for it as well? So we're checking feature flag values for group feature flags. Feel free to copy an existing group test.

AChelikani commented 1 year ago

@neilkakkar added a test, but please feel free to make the test better and merge :) I'm not convinced the test I added is any good lol

neilkakkar commented 1 year ago

Sorry, I couldn't push to your fork, so made it into another PR: https://github.com/PostHog/posthog-go/pull/16

Thank you!