Skip to content

Instantly share code, notes, and snippets.

@sidneyw
Created August 17, 2021 01:29
Show Gist options
  • Save sidneyw/11376e2dcbd601d4de136485c22e0a91 to your computer and use it in GitHub Desktop.
Save sidneyw/11376e2dcbd601d4de136485c22e0a91 to your computer and use it in GitHub Desktop.
import (
"gopkg.in/launchdarkly/go-sdk-common.v2/lduser"
)
flagName := "some-flag-name"
user := lduser.NewUser("some-user-key")
defaultValue := false
showFeature, _ := ldClient.BoolVariation(flagName, user, defaultValue)
if showFeature {
// application code to show the feature
} else {
// the code to run if the feature is off
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment