Created
August 17, 2021 01:29
-
-
Save sidneyw/11376e2dcbd601d4de136485c22e0a91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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