Created
October 11, 2021 08:12
-
-
Save thomaspoignant/dc0a3e91ec6c8b8de83d493b6c6d2a11 to your computer and use it in GitHub Desktop.
Go-feature-flag example
This file contains hidden or 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
/** | |
test-flag: | |
rule: (role eq "devops") and (env eq "pro") and (key eq "[email protected]") and (company eq "go-feature-flag") | |
percentage: 100 | |
true: true | |
false: false | |
default: false | |
*/ | |
user := ffuser.NewUserBuilder("[email protected]"). | |
AddCustom("company", "go-feature-flag"). | |
AddCustom("role", "devops"). | |
AddCustom("env", "pro"). | |
Build() | |
res, _ := ffclient.BoolVariation("test-flag", user, false) | |
// res will be true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment