Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound shows supplied value could not be found for supported underlying type.
Functions ¶
func CastMap ¶
func CastMap[T Basic, U ~map[T]struct{}](val *U) (m *map[T]struct{})
CastMap converts `map[T]struct{}` from `U` (defined type of map). Because if `U` represents as defined type, convert process will be so complicated.
func CastSlice ¶
func CastSlice[T Basic, U ~[]T](val *U) (s *[]T)
CastSlice converts `[]T` from `U` (defined type of slice). Because if `U` represents as defined type, convert process will be so complicated.
func Resolve ¶
Resolve resolves underlying type of value which it receives. supported: (via https://cs.opensource.google/go/x/exp/+/master:constraints/constraints.go) - int, int8, int16, int32, int64 (equivarent of constraints.Signed) - uint, uint8, uint16, uint32, uint64 (equivarent of constraints.Unsigned) - float32, float64 (equivarent of constraints.Float) - string - bool - time.Time - time.Duration if this function receives value except aboves, returns nil.