@@ -27,7 +27,7 @@ func TestBooleanEvaluation(t *testing.T) {
2727
2828 evalCtx := of .NewEvaluationContext (
2929 "" ,
30- map [string ]interface {} {
30+ map [string ]any {
3131 "UserID" : "123" ,
3232 },
3333 )
@@ -51,7 +51,7 @@ func TestStringConfigEvaluation(t *testing.T) {
5151
5252 evalCtx := of .NewEvaluationContext (
5353 "" ,
54- map [string ]interface {} {
54+ map [string ]any {
5555 "UserID" : "123" ,
56565757 "feature_config" : featureConfig ,
@@ -78,7 +78,7 @@ func TestBoolLayerEvaluation(t *testing.T) {
7878
7979 evalCtx := of .NewEvaluationContext (
8080 "" ,
81- map [string ]interface {} {
81+ map [string ]any {
8282 "UserID" : "123" ,
8383 "feature_config" : featureConfig ,
8484 },
@@ -110,8 +110,8 @@ func TestConvertsValidEvaluationContextToStatsigUser(t *testing.T) {
110110 "Country" : "US" ,
111111 "Locale" : "en-US" ,
112112 "AppVersion" : "1.0.0" ,
113- "Custom" : map [string ]interface {} {"customKey" : "customValue" },
114- "PrivateAttributes" : map [string ]interface {} {"privateKey" : "privateValue" },
113+ "Custom" : map [string ]any {"customKey" : "customValue" },
114+ "PrivateAttributes" : map [string ]any {"privateKey" : "privateValue" },
115115 "StatsigEnvironment" : map [string ]string {"envKey" : "envValue" },
116116 "CustomIDs" : map [string ]string {"customIDKey" : "customIDValue" },
117117 "custom-key" : "custom-value" ,
@@ -219,26 +219,26 @@ func TestEvaluationMethods(t *testing.T) {
219219
220220 tests := []struct {
221221 flag string
222- defaultValue interface {}
222+ defaultValue any
223223 evalCtx of.FlattenedContext
224- expected interface {}
224+ expected any
225225 expectedError string
226226 }{
227227 {"always_on_gate" , false , of.FlattenedContext {"UserID" : "123" }, true , "" },
228228
229229 {"boolean" , false , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, true , "" },
230230 {"float" , 1.5999 , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, 1.5 , "" },
231231 {"number" , int64 (42999 ), of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, int64 (42 ), "" },
232- {"object" , map [string ]interface {}{ "key" : "value999" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, map [string ]interface {} {"key1" : "value1" }, "" },
232+ {"object" , map [string ]any { "key" : "value999" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, map [string ]any {"key1" : "value1" }, "" },
233233 {"string" , "default_value" , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, "expected_value" , "" },
234- {"slice" , []interface {}{ "fallback1" , "fallback2" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, []interface {} {"v1" , "v2" }, "" },
234+ {"slice" , []any { "fallback1" , "fallback2" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "valid_flag" }}, []any {"v1" , "v2" }, "" },
235235
236236 {"boolean" , false , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, true , "" },
237237 {"float" , 1.5999 , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, 1.5 , "" },
238238 {"number" , int64 (42999 ), of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, int64 (42 ), "" },
239- {"object" , map [string ]interface {}{ "key" : "value999" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, map [string ]interface {} {"key1" : "value1" }, "" },
239+ {"object" , map [string ]any { "key" : "value999" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, map [string ]any {"key1" : "value1" }, "" },
240240 {"string" , "default_value" , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, "expected_value" , "" },
241- {"slice" , []interface {}{ "fallback1" , "fallback2" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, []interface {} {"v1" , "v2" }, "" },
241+ {"slice" , []any { "fallback1" , "fallback2" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "valid_layer" }}, []any {"v1" , "v2" }, "" },
242242
243243 {"invalid_flag" , false , of.FlattenedContext {"UserID" : "123" }, false , "flag not found" },
244244
@@ -247,12 +247,12 @@ func TestEvaluationMethods(t *testing.T) {
247247
248248 {"float" , 1.23 , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "invalid_flag" }}, 1.23 , "flag not found" },
249249 {"number" , int64 (43 ), of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "invalid_flag" }}, int64 (43 ), "flag not found" },
250- {"object" , map [string ]interface {}{ "key1" : "other-value" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "invalid_flag" }}, map [string ]interface {} {"key1" : "other-value" }, "flag not found" },
250+ {"object" , map [string ]any { "key1" : "other-value" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "invalid_flag" }}, map [string ]any {"key1" : "other-value" }, "flag not found" },
251251 {"string" , "value2" , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "CONFIG" , Name : "invalid_flag" }}, "value2" , "flag not found" },
252252
253253 {"float" , 1.23 , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "invalid_flag" }}, 1.23 , "flag not found" },
254254 {"number" , int64 (43 ), of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "invalid_flag" }}, int64 (43 ), "flag not found" },
255- {"object" , map [string ]interface {}{ "key1" : "other-value" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "invalid_flag" }}, map [string ]interface {} {"key1" : "other-value" }, "flag not found" },
255+ {"object" , map [string ]any { "key1" : "other-value" }, of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "invalid_flag" }}, map [string ]any {"key1" : "other-value" }, "flag not found" },
256256 {"string" , "value2" , of.FlattenedContext {"UserID" : "123" , "feature_config" : statsigProvider.FeatureConfig {FeatureConfigType : "LAYER" , Name : "invalid_flag" }}, "value2" , "flag not found" },
257257
258258 {"invalid_user_context" , false , of.FlattenedContext {"UserID" : "123" , "invalid" : "value" }, false , "" },
0 commit comments