labs

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFeatures

func AllFeatures() []string

AllFeatures returns a list of all known feature names

func EnableAll added in v0.5.0

func EnableAll()

EnableAll enables all known feature flags. This is used when generating help documentation to ensure all commands are registered regardless of feature gating.

func FeatureDescriptions

func FeatureDescriptions() map[string]string

FeatureDescriptions returns a map of feature names to their descriptions

func Init

func Init(log *slog.Logger, flags []string)

Init initializes the labs feature flags from the provided flag strings. Each flag can be a feature name to enable it, or prefixed with "-" to disable it. Unknown feature names are logged as warnings but do not cause an error. This function should be called once at startup.

log is required; pass slog.New(slog.DiscardHandler) to silence it.

func IsEnabled

func IsEnabled(name string) bool

IsEnabled returns whether a feature is enabled. Returns the default value if Init has not been called.

func Reset

func Reset()

Reset resets the feature flags to their default state. This is primarily useful for testing.

Types

This section is empty.

Directories

Path Synopsis
cmd
labsgen command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL