Skip to main content
Version: Next

How to configure a flag

GO Feature Flag core feature is to centralize all your feature flags in a source file, and to avoid hosting and maintaining a backend server to manage them.

Your file must be a valid YAML, JSON or TOML file with a list of flags (examples: YAML, JSON, TOML).


The easiest way to create your configuration file is to used [GO Feature Flag Editor available at

If you prefer to do it manually please follow instruction bellow.


Creating the first version of the flag is not always pleasant, that's why we have created GO Feature Flag Editor a simple editor to create your files.


A flag configuration looks like:

# This is your configuration for your first flag
variations: # All possible return value for your feature flag
A: false
B: true
targeting: # If you want to target a subset of your users in particular
- query: key eq "random-key"
A: 0
B: 100
defaultRule: # When no targeting match we use the defaultRule
variation: A

# A second example of a flag configuration
A: "valueA"
B: "valueB"
defaultValue: "a default value"
- name: legacyRuleV0
query: key eq "not-a-key"
A: 10
B: 90
name: legacyDefaultRule
variation: defaultValue
version: "12"
start: 2021-03-20T00:00:00.1-05:00
end: 2021-03-21T00:00:00.1-05:00

Format details

flag-keyName of your flag.
It must be unique.
On the example the flag keys are test-flag and test-flag2.

Variations are all the variations available for this flag.

It is represented as a key/value element. The key is the name of the variation and the value could be any types available (string, float, int, map, array, bool).

You can have as many variation as needed.

# Some examples
variationString: test
variationBool: true
variationInt: 1000
variationFloat: 1000.23
- item1
- item2
item1: 123
item2: this is a string
item3: false

Targeting contains the list of rules you have to target a subset of your users.
You can have as many target as needed.

This field is an array and contains a list of rules.

See rules format to have more info on how to write a rule.


DefaultRule is the rule that is applied if the user does not match in any targeting.

See rules format to have more info on how to write a rule.


false if you don't want to export the data in your data exporter.

Default: true


true if the flag is disabled.

Default: false


The version is the version of your flag.
This string is used to display the information in the notifiers and data collection, you have to update it your self.

Default: ""


Scheduled allow to patch your flag over time.

You can add several steps that updates the flag, this is typically used if you want to gradually add more user in your flag.

See Scheduled rollout to have more info on how to use it.


Experimentation allow you to configure a start date and an end date for your flag. When the experimentation is not running, the flag will serve the default value.

See Experimentation rollout to have more info on how to use it.

Advanced configurations

You can have advanced configurations for your flag to have specific behavior for them, such as:

Get the latest GO Feature Flag updates