gorgeous-angle-33742
05/16/2022, 6:29 AMb, _ := json.Marshal(jsonMap["features"])
features := growthbook.ParseFeatureMap(b)
contextGB := growthbook.NewContext().
WithFeatures(features).
WithAttributes(growthbook.Attributes{
"Key": ID,
})
gb := growthbook.New(contextGB)
if gb.Feature("backend_enable_digilocker").On {
log.Println("FEATURE IS ON")
}
fresh-football-47124
gorgeous-angle-33742
05/16/2022, 6:31 AMfresh-football-47124
gorgeous-angle-33742
05/16/2022, 6:43 AM"features": {
"manual_upload_button_visibility": {
"defaultValue": true,
"rules": [
{
"variations": [
true,
false
],
"weights": [
0.5,
0.5
],
"key": "manual_upload_button_visibility",
"hashAttribute": "linkID"
}
]
},
"backend_enable_digilocker": {
"defaultValue": false,
"rules": [
{
"variations": [
false,
true
],
"weights": [
0.5,
0.5
],
"hashAttribute": "linkID"
}
]
}
}
WithAttributes(growthbook.Attributes{
"linkID": ID,
})
fresh-football-47124
WithAttributes(growthbook.Attributes{
"Key": ID,
})
gorgeous-angle-33742
05/16/2022, 6:49 AMfresh-football-47124
gorgeous-angle-33742
05/16/2022, 6:58 AMfresh-football-47124
gorgeous-angle-33742
05/16/2022, 7:00 AMfresh-football-47124
gorgeous-angle-33742
05/16/2022, 7:17 AMfresh-football-47124