Multiple Configuration Flags for GO Feature Flag ποΈ
Are you tired of managing your feature flags with a single configuration flag?
We've got good news for you GO feature flag now supports multiple configuration flags! Plus, we've added a new feature that allows all files to be loaded in parallel, making it faster and more efficient.

Managing feature flags can be a challenging task, especially as your application grows and becomes more complex. With multiple configuration flags, you can easily manage different feature flag configurations for different apps, user groups, or any other criteria that you need. You can also use the same flags for multiple features, making it easier to maintain and update your code.
In addition to multiple configuration flags, we've also ensured that all files are downloaded in parallel. This means that your feature flag configurations will be downloaded faster and more efficiently, improving the performance of your application.
How to configure multiple flag configuration filesβ
To configure GO Feature Flag using multiple configuration flags files, simply create multiple files and store them in your favorite place.
Then, use the field retrievers in your configuration to configure all the access to your configuration flags.
- Relay Proxy Configuration
- GO Module Configuration
# ...
retrievers:
- kind: http
url: https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/examples/retriever_file/flags.yaml
- kind: file
path: /local/flag-file.yaml # Example of local path
- kind: http # you can have multiple time the same type of retriever
url: https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/testdata/flag-config.yaml
# Before we were using the field retriever that allows only one retriever at the time
#
# retriever:
# kind: http
# url: https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/examples/retriever_file/flags.yaml
err := ffclient.Init(ffclient.Config{
// ...
Retrievers: []retriever.Retriever{
&fileretriever.Retriever{
Path: "examples/retriever_multiple_config_files/flags.yaml",
},
&fileretriever.Retriever{
Path: "examples/retriever_multiple_config_files/flags2.yaml",
},
},
//...
// Before we were using the field retriever that allows only one retriever at the time
//
// Retriever: &fileretriever.Retriever{
// Path: "examples/retriever_multiple_config_files/flags.yaml",
// },
})
