Documentation ¶ Index ¶ func ValueOf[T Constant[T]]() T type Constant type Running func (c Running) Default() Running func (c Running) MarshalJSON() ([]byte, error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ValueOf ¶ func ValueOf[T Constant[T]]() T ValueOf gives the default value of a constant from its type. It's helpful when constructing constants as variants in a one-of. Note that empty structs are marshalled by default. Usage: constant.ValueOf[constant.Foo]() Types ¶ type Constant ¶ type Constant[T any] interface { Default() T } type Running ¶ added in v0.3.0 type Running string // Always "running" func (Running) Default ¶ added in v0.3.0 func (c Running) Default() Running func (Running) MarshalJSON ¶ added in v0.3.0 func (c Running) MarshalJSON() ([]byte, error) Source Files ¶ View all Source files constants.go Click to show internal directories. Click to hide internal directories.