package
module
Version:
v1.0.4
Opens a new window with list of versions in this module.
Published: Sep 5, 2025
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 3
Opens a new window with list of known importers.
README
¶
features
Simple implementation of the flags feature.
Usage
import "github.com/bavix/features"
const (
Dishing features.Flag = iota
Washing
Cooking
Driving
)
//...
toggles := features.New(Dishing, Washing, Cooking)
toggles.Has(Cooking) // true
toggles.Has(Driving) // false
Documentation
¶
New creates a new Toggles instance with the specified flags set.
Has checks if all the specified flags are set in the Toggles instance.
It returns true if all flags are present, otherwise false.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.