Skip to main content
Version: v1.34.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 we have introduced the go-feature-flag-lint, a command line tool that 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 linter

Install using Homebrew (mac and linux)

brew tap thomaspoignant/homebrew-tap
brew install go-feature-flag-lint

Install using Scoop (windows)

scoop bucket add org https://github.com/go-feature-flag/scoop.git
scoop install go-feature-flag-lint

Install using Docker

docker pull thomaspoignant/go-feature-flag-lint:latest

Use the linter

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

The command line has 2 arguments you should specify.

paramdescription
--input-file(mandatory) The location of your configuration file.
--input-format(mandatory) 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-lint 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