Skip to content

altipla-consulting/features-go

Repository files navigation

features-go

Go Reference

Feature Flags Go client.

Install

go get github.com/altipla-consulting/features-go

Usage

Configure features

To configure features, you need to run features configure, passing the server URL and the project corresponding to the flags.

func main() {
  features.Configure("https://youserver.com", "project")
}

Check feature flag is enabled

if features.Flag(ctx, "feature") {
    fmt.Print("Feature flag is enabled.")
}

Check feature flag is enabled with tenant

if features.Flag(ctx, "feature", features.WithTenant("tenant")) {
    fmt.Print("Feature flag is enabled with tenant.")
}

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using make gofmt.

License

MIT License

Contributors 2

  •  
  •