Skip to main content
Version: v1.39.0

Lint your configuration file

Ensuring the accuracy of your configuration is vital for the GO Feature Flag to function as expected. This is why you can lint your configuration file using the go-feature-flag-cli, a command line tool that allow to interact with GO Feature Flag in your terminal. The lint command validates whether a flag file can be parsed by GO Feature Flag.

tip

We recommend you to use this command line in your CI/CD pipelines to avoid any unforeseen issues.

Install the Command Line

Check the installation guide to install the go-feature-flag-cli.

Use the linter

./go-feature-flag-cli lint /input/my-go-feature-flag-config.goff.yaml --format=yaml

You have to pass the location of your configuration file and the format of your current configuration file (available formats are yaml, json, toml).

Use the linter in your CI (continuous integration)

You can run go-feature-flag-cli directly in your CI:

name: "Build"
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint the config file
uses: go-feature-flag/gofeatureflag-lint-action@v1
with:
flag-file: ./path/to/your/config.yaml
format: yaml

Get the latest GO Feature Flag updates