Skip to content

Instantly share code, notes, and snippets.

@thomaspoignant
Created October 11, 2021 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaspoignant/dc0a3e91ec6c8b8de83d493b6c6d2a11 to your computer and use it in GitHub Desktop.
Save thomaspoignant/dc0a3e91ec6c8b8de83d493b6c6d2a11 to your computer and use it in GitHub Desktop.
Go-feature-flag example
/**
test-flag:
rule: (role eq "devops") and (env eq "pro") and (key eq "example@test.com") and (company eq "go-feature-flag")
percentage: 100
true: true
false: false
default: false
*/
user := ffuser.NewUserBuilder("example@test.com").
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