From e137bcf1c18a057a62712784b5a6c41e98e1d5bf Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 12 May 2022 17:58:28 -0400 Subject: [PATCH 1/9] allow specifying environment in config, and use in rules --- config.go | 7 ++++++- internal/flag/flag.go | 4 ++-- internal/flagv1/flag_data.go | 22 ++++++++++++---------- internal/flagv1/flag_priv_test.go | 5 +++-- internal/flagv1/flag_pub_test.go | 29 +++++++++++++++-------------- variation.go | 17 +++++++++-------- 6 files changed, 47 insertions(+), 37 deletions(-) diff --git a/config.go b/config.go index ce5eef82092..d4e537265da 100644 --- a/config.go +++ b/config.go @@ -3,10 +3,11 @@ package ffclient import ( "context" "errors" - "github.com/thomaspoignant/go-feature-flag/ffnotifier" "log" "time" + "github.com/thomaspoignant/go-feature-flag/ffnotifier" + "github.com/thomaspoignant/go-feature-flag/internal" "github.com/thomaspoignant/go-feature-flag/internal/notifier" ) @@ -27,6 +28,10 @@ type Config struct { // Default: context.Background() Context context.Context + // Environment (optional), can be checked in feature flag rules + // Default: "" + Environment string + // Retriever is the component in charge to retrieve your flag file Retriever Retriever diff --git a/internal/flag/flag.go b/internal/flag/flag.go index 10f077ec71d..74974d60428 100644 --- a/internal/flag/flag.go +++ b/internal/flag/flag.go @@ -6,8 +6,8 @@ import ( type Flag interface { // Value is returning the Value associate to the flag (True / False / Default ) based - // if the flag apply to the user or not. - Value(flagName string, user ffuser.User) (interface{}, string) + // if the flag apply to the user and environment or not. + Value(flagName string, user ffuser.User, environment string) (interface{}, string) // String display correctly a flag with the right formatting String() string diff --git a/internal/flagv1/flag_data.go b/internal/flagv1/flag_data.go index f069d98612e..66ea51773e1 100644 --- a/internal/flagv1/flag_data.go +++ b/internal/flagv1/flag_data.go @@ -2,13 +2,14 @@ package flagv1 import ( "fmt" - "github.com/nikunjy/rules/parser" - "github.com/thomaspoignant/go-feature-flag/ffuser" - "github.com/thomaspoignant/go-feature-flag/internal/utils" "math" "strconv" "strings" "time" + + "github.com/nikunjy/rules/parser" + "github.com/thomaspoignant/go-feature-flag/ffuser" + "github.com/thomaspoignant/go-feature-flag/internal/utils" ) // percentageMultiplier is the multiplier used to have a bigger range of possibility. @@ -55,14 +56,14 @@ type FlagData struct { // Value is returning the Value associate to the flag (True / False / Default ) based // if the toggle apply to the user or not. -func (f *FlagData) Value(flagName string, user ffuser.User) (interface{}, string) { +func (f *FlagData) Value(flagName string, user ffuser.User, environment string) (interface{}, string) { f.updateFlagStage() if f.isExperimentationOver() { // if we have an experimentation that has not started or that is finished we use the default value. return f.getDefault(), VariationDefault } - if f.evaluateRule(user) { + if f.evaluateRule(user, environment) { if f.isInPercentage(flagName, user) { // Rule applied and user in the cohort. return f.getTrue(), VariationTrue @@ -77,9 +78,8 @@ func (f *FlagData) Value(flagName string, user ffuser.User) (interface{}, string func (f *FlagData) isExperimentationOver() bool { now := time.Now() - return f.Rollout != nil && f.Rollout.Experimentation != nil && ( - (f.Rollout.Experimentation.Start != nil && now.Before(*f.Rollout.Experimentation.Start)) || - (f.Rollout.Experimentation.End != nil && now.After(*f.Rollout.Experimentation.End))) + return f.Rollout != nil && f.Rollout.Experimentation != nil && ((f.Rollout.Experimentation.Start != nil && now.Before(*f.Rollout.Experimentation.Start)) || + (f.Rollout.Experimentation.End != nil && now.After(*f.Rollout.Experimentation.End))) } // isInPercentage check if the user is in the cohort for the toggle. @@ -101,7 +101,7 @@ func (f *FlagData) isInPercentage(flagName string, user ffuser.User) bool { } // evaluateRule is checking if the rule can apply to a specific user. -func (f *FlagData) evaluateRule(user ffuser.User) bool { +func (f *FlagData) evaluateRule(user ffuser.User, environment string) bool { // Flag disable we cannot apply it. if f.GetDisable() { return false @@ -113,7 +113,9 @@ func (f *FlagData) evaluateRule(user ffuser.User) bool { } // Evaluate the rule on the user. - return parser.Evaluate(f.getRule(), utils.UserToMap(user)) + userMap := utils.UserToMap(user) + userMap["env"] = environment + return parser.Evaluate(f.getRule(), userMap) } // string display correctly a flag diff --git a/internal/flagv1/flag_priv_test.go b/internal/flagv1/flag_priv_test.go index 0fdb2cb80df..e48f6629e01 100644 --- a/internal/flagv1/flag_priv_test.go +++ b/internal/flagv1/flag_priv_test.go @@ -1,10 +1,11 @@ package flagv1 import ( - "github.com/stretchr/testify/assert" "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/thomaspoignant/go-feature-flag/ffuser" "github.com/thomaspoignant/go-feature-flag/testutils/testconvert" ) @@ -87,7 +88,7 @@ func TestFlag_evaluateRule(t *testing.T) { False: testconvert.Interface(tt.fields.False), } - got := f.evaluateRule(tt.args.user) + got := f.evaluateRule(tt.args.user, "") assert.Equal(t, tt.want, got) }) } diff --git a/internal/flagv1/flag_pub_test.go b/internal/flagv1/flag_pub_test.go index b4e99302fca..ec6cb38a38c 100644 --- a/internal/flagv1/flag_pub_test.go +++ b/internal/flagv1/flag_pub_test.go @@ -2,11 +2,12 @@ package flagv1_test import ( "fmt" + "testing" + "time" + "github.com/stretchr/testify/assert" "github.com/thomaspoignant/go-feature-flag/internal/flag" flagv1 "github.com/thomaspoignant/go-feature-flag/internal/flagv1" - "testing" - "time" "github.com/thomaspoignant/go-feature-flag/ffuser" "github.com/thomaspoignant/go-feature-flag/testutils/testconvert" @@ -336,7 +337,7 @@ func TestFlag_value(t *testing.T) { Rollout: &tt.fields.Rollout, } - got, variationType := f.Value(tt.args.flagName, tt.args.user) + got, variationType := f.Value(tt.args.flagName, tt.args.user, "") assert.Equal(t, tt.want.value, got) assert.Equal(t, tt.want.variationType, variationType) }) @@ -361,15 +362,15 @@ func TestFlag_ProgressiveRollout(t *testing.T) { flagName := "test-flag" // We evaluate the same flag multiple time overtime. - v, _ := f.Value(flagName, user) + v, _ := f.Value(flagName, user, "") assert.Equal(t, f.GetVariationValue(flagv1.VariationFalse), v) time.Sleep(1 * time.Second) - v2, _ := f.Value(flagName, user) + v2, _ := f.Value(flagName, user, "") assert.Equal(t, f.GetVariationValue(flagv1.VariationFalse), v2) time.Sleep(1 * time.Second) - v3, _ := f.Value(flagName, user) + v3, _ := f.Value(flagName, user, "") assert.Equal(t, f.GetVariationValue(flagv1.VariationTrue), v3) } @@ -446,43 +447,43 @@ func TestFlag_ScheduledRollout(t *testing.T) { flagName := "test-flag" // We evaluate the same flag multiple time overtime. - v, _ := f.Value(flagName, user) + v, _ := f.Value(flagName, user, "") assert.Equal(t, f.GetVariationValue(flagv1.VariationFalse), v) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "True", v) assert.Equal(t, 1.1, f.GetVersion()) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "Default2", v) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "True2", v) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "Default2", v) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "Default2", v) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "True2", v) time.Sleep(1 * time.Second) - v, _ = f.Value(flagName, user) + v, _ = f.Value(flagName, user, "") assert.Equal(t, "Default2", v) } diff --git a/variation.go b/variation.go index 3466fbe7be6..567219a61d2 100644 --- a/variation.go +++ b/variation.go @@ -2,6 +2,7 @@ package ffclient import ( "fmt" + "github.com/thomaspoignant/go-feature-flag/ffexporter" "github.com/thomaspoignant/go-feature-flag/ffuser" "github.com/thomaspoignant/go-feature-flag/internal/flag" @@ -140,7 +141,7 @@ func (g *GoFeatureFlag) AllFlagsState(user ffuser.User) flagstate.AllFlags { allFlags := flagstate.NewAllFlags() for key, currentFlag := range flags { - flagValue, varType := currentFlag.Value(key, user) + flagValue, varType := currentFlag.Value(key, user, g.config.Environment) switch v := flagValue; v.(type) { case int, float64, bool, string, []interface{}, map[string]interface{}: allFlags.AddFlag(key, flagstate.NewFlagState(currentFlag.GetTrackEvents(), v, varType, false)) @@ -171,7 +172,7 @@ func (g *GoFeatureFlag) boolVariation(flagKey string, user ffuser.User, sdkDefau }, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res, ok := flagValue.(bool) if !ok { return model.BoolVarResult{ @@ -199,7 +200,7 @@ func (g *GoFeatureFlag) intVariation(flagKey string, user ffuser.User, sdkDefaul }, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res, ok := flagValue.(int) if !ok { // if this is a float64 we convert it to int @@ -236,7 +237,7 @@ func (g *GoFeatureFlag) float64Variation(flagKey string, user ffuser.User, sdkDe }, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res, ok := flagValue.(float64) if !ok { return model.Float64VarResult{ @@ -266,7 +267,7 @@ func (g *GoFeatureFlag) stringVariation(flagKey string, user ffuser.User, sdkDef }, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res, ok := flagValue.(string) if !ok { return model.StringVarResult{ @@ -296,7 +297,7 @@ func (g *GoFeatureFlag) jsonArrayVariation(flagKey string, user ffuser.User, sdk }, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res, ok := flagValue.([]interface{}) if !ok { return model.JSONArrayVarResult{ @@ -326,7 +327,7 @@ func (g *GoFeatureFlag) jsonVariation(flagKey string, user ffuser.User, sdkDefau }, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res, ok := flagValue.(map[string]interface{}) if !ok { return model.JSONVarResult{ @@ -376,7 +377,7 @@ func (g *GoFeatureFlag) RawVariation(flagKey string, user ffuser.User, sdkDefaul return res, err } - flagValue, variationType := f.Value(flagKey, user) + flagValue, variationType := f.Value(flagKey, user, g.config.Environment) res := model.RawVarResult{ Value: flagValue, VariationResult: computeVariationResult(f, variationType, false), From 50edfb68bcd86f297f707cc2027ea4f489800a88 Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 17:56:46 -0400 Subject: [PATCH 2/9] revert extraneous changes --- config.go | 3 +-- internal/flagv1/flag_data.go | 12 ++++++------ internal/flagv1/flag_priv_test.go | 3 +-- internal/flagv1/flag_pub_test.go | 4 ++-- variation.go | 1 - 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/config.go b/config.go index d4e537265da..80c9e5c8b34 100644 --- a/config.go +++ b/config.go @@ -3,11 +3,10 @@ package ffclient import ( "context" "errors" + "github.com/thomaspoignant/go-feature-flag/ffnotifier" "log" "time" - "github.com/thomaspoignant/go-feature-flag/ffnotifier" - "github.com/thomaspoignant/go-feature-flag/internal" "github.com/thomaspoignant/go-feature-flag/internal/notifier" ) diff --git a/internal/flagv1/flag_data.go b/internal/flagv1/flag_data.go index 66ea51773e1..50c5d5a89e8 100644 --- a/internal/flagv1/flag_data.go +++ b/internal/flagv1/flag_data.go @@ -2,14 +2,13 @@ package flagv1 import ( "fmt" + "github.com/nikunjy/rules/parser" + "github.com/thomaspoignant/go-feature-flag/ffuser" + "github.com/thomaspoignant/go-feature-flag/internal/utils" "math" "strconv" "strings" "time" - - "github.com/nikunjy/rules/parser" - "github.com/thomaspoignant/go-feature-flag/ffuser" - "github.com/thomaspoignant/go-feature-flag/internal/utils" ) // percentageMultiplier is the multiplier used to have a bigger range of possibility. @@ -78,8 +77,9 @@ func (f *FlagData) Value(flagName string, user ffuser.User, environment string) func (f *FlagData) isExperimentationOver() bool { now := time.Now() - return f.Rollout != nil && f.Rollout.Experimentation != nil && ((f.Rollout.Experimentation.Start != nil && now.Before(*f.Rollout.Experimentation.Start)) || - (f.Rollout.Experimentation.End != nil && now.After(*f.Rollout.Experimentation.End))) + return f.Rollout != nil && f.Rollout.Experimentation != nil && ( + (f.Rollout.Experimentation.Start != nil && now.Before(*f.Rollout.Experimentation.Start)) || + (f.Rollout.Experimentation.End != nil && now.After(*f.Rollout.Experimentation.End))) } // isInPercentage check if the user is in the cohort for the toggle. diff --git a/internal/flagv1/flag_priv_test.go b/internal/flagv1/flag_priv_test.go index e48f6629e01..1329b011b04 100644 --- a/internal/flagv1/flag_priv_test.go +++ b/internal/flagv1/flag_priv_test.go @@ -1,11 +1,10 @@ package flagv1 import ( + "github.com/stretchr/testify/assert" "testing" "time" - "github.com/stretchr/testify/assert" - "github.com/thomaspoignant/go-feature-flag/ffuser" "github.com/thomaspoignant/go-feature-flag/testutils/testconvert" ) diff --git a/internal/flagv1/flag_pub_test.go b/internal/flagv1/flag_pub_test.go index ec6cb38a38c..0d00c56e2e6 100644 --- a/internal/flagv1/flag_pub_test.go +++ b/internal/flagv1/flag_pub_test.go @@ -2,12 +2,12 @@ package flagv1_test import ( "fmt" - "testing" - "time" "github.com/stretchr/testify/assert" "github.com/thomaspoignant/go-feature-flag/internal/flag" flagv1 "github.com/thomaspoignant/go-feature-flag/internal/flagv1" + "testing" + "time" "github.com/thomaspoignant/go-feature-flag/ffuser" "github.com/thomaspoignant/go-feature-flag/testutils/testconvert" diff --git a/variation.go b/variation.go index 567219a61d2..9ea31db5005 100644 --- a/variation.go +++ b/variation.go @@ -2,7 +2,6 @@ package ffclient import ( "fmt" - "github.com/thomaspoignant/go-feature-flag/ffexporter" "github.com/thomaspoignant/go-feature-flag/ffuser" "github.com/thomaspoignant/go-feature-flag/internal/flag" From 1e04cbf8fa1849fa7190744b343eae9c2dd343d3 Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 17:59:05 -0400 Subject: [PATCH 3/9] Update internal/flagv1/flag_data.go Co-authored-by: Thomas Poignant --- internal/flagv1/flag_data.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/flagv1/flag_data.go b/internal/flagv1/flag_data.go index 50c5d5a89e8..31cd9e27966 100644 --- a/internal/flagv1/flag_data.go +++ b/internal/flagv1/flag_data.go @@ -114,7 +114,9 @@ func (f *FlagData) evaluateRule(user ffuser.User, environment string) bool { // Evaluate the rule on the user. userMap := utils.UserToMap(user) - userMap["env"] = environment + if environment != "" { + userMap["env"] = environment + } return parser.Evaluate(f.getRule(), userMap) } From fef00cb46e095c48deabcf601ca7403a195e9722 Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 18:58:33 -0400 Subject: [PATCH 4/9] revert extraneous change --- internal/flagv1/flag_pub_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/flagv1/flag_pub_test.go b/internal/flagv1/flag_pub_test.go index 0d00c56e2e6..b42616f3d9c 100644 --- a/internal/flagv1/flag_pub_test.go +++ b/internal/flagv1/flag_pub_test.go @@ -2,7 +2,6 @@ package flagv1_test import ( "fmt" - "github.com/stretchr/testify/assert" "github.com/thomaspoignant/go-feature-flag/internal/flag" flagv1 "github.com/thomaspoignant/go-feature-flag/internal/flagv1" From 753f18dce33f0b787ca0ed5060454b3b718825cd Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 19:10:49 -0400 Subject: [PATCH 5/9] add tests for environment --- internal/flagv1/flag_priv_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/internal/flagv1/flag_priv_test.go b/internal/flagv1/flag_priv_test.go index 1329b011b04..c0157e765ef 100644 --- a/internal/flagv1/flag_priv_test.go +++ b/internal/flagv1/flag_priv_test.go @@ -19,6 +19,7 @@ func TestFlag_evaluateRule(t *testing.T) { } type args struct { user ffuser.User + env string } tests := []struct { name string @@ -76,6 +77,28 @@ func TestFlag_evaluateRule(t *testing.T) { }, want: false, }, + { + name: "Rolled out to environment", + fields: fields{ + Rule: "env == \"staging\"", + }, + args: args{ + user: ffuser.NewAnonymousUser(""), + env: "staging", + }, + want: true, + }, + { + name: "Not rolled out to environment", + fields: fields{ + Rule: "env != \"production\"", + }, + args: args{ + user: ffuser.NewAnonymousUser(""), + env: "production", + }, + want: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 4fc47a0848f436edc80f3296e5e5417ae3be783c Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 19:18:21 -0400 Subject: [PATCH 6/9] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 705a20e8147..6b5fd6288b3 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ ffclient.Init(ffclient.Config{ }, }, StartWithRetrieverError: false, + Environment: os.Getenv("MYAPP_ENV"), }) ``` ### Configuration fields @@ -126,6 +127,7 @@ ffclient.Init(ffclient.Config{ |---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `Retriever` | The configuration retriever you want to use to get your flag file.
*See [Store your flag file](https://thomaspoignant.github.io/go-feature-flag/latest/flag_file/) for the configuration details*. | | `Context` | *(optional)*
The context used by the retriever.
Default: `context.Background()` | +| `Environment` | *(optional)*
The environment the app is running under, can be checked in feature flag rules.
Default: `""` | | `DataExporter` | *(optional)*
DataExporter defines how to export data on how your flags are used.
*see [export data section](https://thomaspoignant.github.io/go-feature-flag/latest/data_collection/) for more details*. | | `FileFormat` | *(optional)*
Format of your configuration file. Available formats are `yaml`, `toml` and `json`, if you omit the field it will try to unmarshal the file as a `yaml` file.
Default: `YAML` | | `Logger` | *(optional)*
Logger used to log what `go-feature-flag` is doing.
If no logger is provided the module will not log anything.
Default: No log | From 5e641c1a50556c625dc04ae5232015d0045ca38d Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 19:20:28 -0400 Subject: [PATCH 7/9] Update configuration.md --- docs/configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 588ebfd8c37..9e4d9fd21a2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -10,6 +10,7 @@ During the initialization you must give a [`ffclient.Config{}`](https://pkg.go.d |---|---| |`Retriever` | The configuration retriever you want to use to get your flag file
*See [Store your flag file](flag_file/index.md) for the configuration details*.| |`Context` | *(optional)*
The context used by the retriever.
Default: `context.Background()`| +|`Environment` | *(optional)*
The environment the app is running under, can be checked in feature flag rules.
Default: `""`| |`DataExporter` | *(optional)*
DataExporter defines how to export data on how your flags are used.
*see [export data section](data_collection/index.md) for more details*.| |`FileFormat`| *(optional)*
Format of your configuration file. Available formats are `yaml`, `toml` and `json`, if you omit the field it will try to unmarshal the file as a `yaml` file.
Default: `YAML`| |`Logger` | *(optional)*
Logger used to log what `go-feature-flag` is doing.
If no logger is provided the module will not log anything.
Default: No log| @@ -24,6 +25,7 @@ ffclient.Init(ffclient.Config{ PollingInterval: 3 * time.Second, Logger: log.New(file, "/tmp/log", 0), Context: context.Background(), + Environment: os.Getenv("MYAPP_ENV"), Retriever: &ffclient.FileRetriever{Path: "testdata/flag-config.yaml"}, FileFormat: "yaml", Notifiers: []ffclient.NotifierConfig{ From dbdd4efdf4fa66573b5ad67ecaec52c9b4befda0 Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Thu, 9 Jun 2022 19:35:44 -0400 Subject: [PATCH 8/9] pass env to test --- internal/flagv1/flag_priv_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/flagv1/flag_priv_test.go b/internal/flagv1/flag_priv_test.go index c0157e765ef..01e244ed412 100644 --- a/internal/flagv1/flag_priv_test.go +++ b/internal/flagv1/flag_priv_test.go @@ -110,7 +110,7 @@ func TestFlag_evaluateRule(t *testing.T) { False: testconvert.Interface(tt.fields.False), } - got := f.evaluateRule(tt.args.user, "") + got := f.evaluateRule(tt.args.user, tt.args.env) assert.Equal(t, tt.want, got) }) } From a2f1c0fc1beae203321d05ad1561080a7597c7de Mon Sep 17 00:00:00 2001 From: Matthew Tom-Wolverton Date: Mon, 20 Jun 2022 20:25:36 -0400 Subject: [PATCH 9/9] gofmt --- internal/flagv1/flag_data.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/flagv1/flag_data.go b/internal/flagv1/flag_data.go index 6db747bb0b7..b72eb2edf27 100644 --- a/internal/flagv1/flag_data.go +++ b/internal/flagv1/flag_data.go @@ -117,7 +117,7 @@ func (f *FlagData) evaluateRule(user ffuser.User, environment string) bool { userMap := utils.UserToMap(user) if environment != "" { userMap["env"] = environment - } + } return parser.Evaluate(f.getRule(), userMap) }