MCPcopy
hub / github.com/spf13/cast / Basic

Interface Basic

cast.go:17–19  ·  view source on GitHub ↗

Basic is a type parameter constraint for functions accepting basic types. It represents the supported basic types this package can cast to.

Source from the content-addressed store, hash-verified

15//
16// It represents the supported basic types this package can cast to.
17type Basic interface {
18 string | bool | Number | time.Time | time.Duration
19}
20
21// ToE casts any value to a [Basic] type.
22func ToE[T Basic](i any) (T, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…