/openfeature

Showing how to use OpenFeature in Golang

Primary LanguageGoMIT LicenseMIT

Build & Test

OpenFeature

Showing how to use OpenFeature in Golang API

Reference docs:

Prerequisites

Optional requisites:

  • Visual Studio Code (for debugging)

Run the demo

  1. open a terminal and go to this repo root
  2. docker compose up (Ctrl+c to abort)
  3. open a browser and go to http://localhost:7357/hello
  4. open file flagd/flags.flagd.json
    • change flags.welcome-message.defaultVariant to "on"
  5. refresh site on http://localhost:7357/hello
    • the text should be different 😊

Run with VSCode debugger

  1. open a terminal and go to this repo root
  2. code .
    • VS Code should start 😎
  3. in the previous terminal or a new terminal in VS Code, run go get ./...
  4. new terminal, run docker compose up flagd (Ctrl+x to abort)
  5. in VS Code, go to the "Run and Debug" section (windows press Ctrl+Shift+d), and press ▶️ the play button (or F5)
  6. View the "Debug Console" to see output

To test in a cluster