Flags
The Go SDK provides two surfaces for FlowCatalyst feature flags:
- Definition sync (
pkg/fcsdk/sync): declareBOOLand closedENUMflags alongside roles, event types and subscriptions in async.DefinitionSet. - Runtime resource client (
pkg/fcsdk/flags): fetch conditional snapshots (ETag/304 Not Modified), open the SSE watch stream, and manage delegated client overrides withX-On-Behalf-Of.
If your service uses the Go application framework, prefer Platform flags (flowcatalyst.PlatformFlags + go/flags), which wraps this wire protocol with an atomic in-memory snapshot evaluator, health check, metrics and flagsadmin.
Declare and sync flags
Section titled “Declare and sync flags”set := sync.ForApplication("orders"). AddFeatureFlag(sync.MakeBoolFlag("checkout.express", false). WithDescription("Enable one-click express checkout"). WithLifecycle("RELEASE"). WithGovernance("CLIENT_MANAGED"). WithExposeToClient(true). WithReviewAfter("2026-12-31")). AddFeatureFlag(sync.MakeEnumFlag("routing.engine", []string{"standard", "fast"}, "standard"). WithDescription("Route calculation engine"). WithLifecycle("EXPERIMENT"). WithGovernance("OPERATORS_ONLY"))
res := sync.NewSynchronizer(fcClient).Sync(ctx, set, sync.DefaultOptions())Fetch snapshots and watch live changes
Section titled “Fetch snapshots and watch live changes”flagsClient := flags.New(fcClient)
// Conditional snapshot fetch (returns changed=false on 304 Not Modified)snap, changed, err := flagsClient.FetchSnapshot(ctx, "orders", currentRevision)if err != nil { return err}if changed { currentRevision = snap.Revision // update local cache}
// Subscribe to live revision invalidations over SSEerr = flagsClient.Watch(ctx, "orders", func(revision string) { // trigger conditional FetchSnapshot refresh})Delegated client overrides
Section titled “Delegated client overrides”oboCtx := client.WithOnBehalfOf(ctx, actingPrincipalID)
_, err := flagsClient.SetClientOverride(oboCtx, "orders", "checkout.express", "acme", &flags.SetClientOverrideRequest{Value: false})
err = flagsClient.DeleteClientOverride(oboCtx, "orders", "checkout.express", "acme")Note that SetClientOverrideRequest uses explicit JSON marshalling so setting Value to false is always transmitted rather than omitted.