https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
a

agreeable-france-58035

11/25/2023, 4:06 AM
Hi team, Facing a small issue with Growthbook forced values for groups in Golang. I've setup a feature which uses Forced value. The runtime group with the identifier
awesome-engineers
is set to receive the value as 'ON'. I was able to test that it works correctly using the simulation. However, when I try to get the value in code using EvalFeature, it still seems to return it as False. Have I missed something here? Attaching the code snippet.
Copy code
var grp []string
    grp = append(grp, "awesome-engineers")
    growthbookCtx.WithAttributes(growthbook.Attributes{
        "id":      "test123",
        "$groups": grp,
    })

Val := growthbookCtx.EvalFeature("group-test").Value // Somehow returns False
r

rhythmic-agent-34208

11/25/2023, 4:06 AM
Our official support hours are 6:30am - 5pm Pacific Time, Monday through Friday. You may occasionally hear from us outside of these hours. Your support request has been logged in our system. Our support team will get back to you very soon!
f

fresh-football-47124

11/25/2023, 4:08 AM
Are you using v1 or v2 of the hashing algorithm?
You may want to set the experiment to v1 to ensure consistent hashing - there is a little caution triangle you can read more about it
👀 1
a

agreeable-france-58035

11/25/2023, 4:22 AM
We are using the Go SDK version v0.1.9, so V2 hashing. Do i need to change anything in this case?
f

fresh-football-47124

11/25/2023, 4:23 AM
Hrmm, no, if it supports v2 it should give the same results
you have an extra 1 in the tester
test1123 vs test123
a

agreeable-france-58035

11/25/2023, 6:13 AM
It's using the "groups = awesome-engineers" condition, so the Id value shouldn't matter I'm guessing? (it's giving the expected output via the tester though 🙂 just the SDK code that is somehow not evaluating it)
Do I need an 'Experiment ref rule' while having a 'Forced rule' in place for the sdk to be able to get the correct forced value?
f

fresh-football-47124

11/25/2023, 8:13 AM
the conditions you have there don’t effect assignment bucketing, but it does filter who the rule applies to
The rules are processed in order
and the first matching rule is used
a

agreeable-france-58035

11/25/2023, 10:43 PM
Thanks Graham !
3 Views