Documentation ¶
Overview ¶
Package conv provides a simple way to convert between types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deref ¶
Deref returns the value of the pointer v if the pointer is nil then it returns untyped nil nil != (*int)(nil)
func NumberSlice ¶
func NumberSlice[T, S Numbers](vs []S) []T
NumberSlice converts a slice of numbers (int8,int16, and so on ...)
func ToAnySlice ¶
ToAnySlice converts a []T to []any, useful to pass params.
func ToNumberSlice ¶
Convert []any to a typed T if an element has an invalid converstion a zero T will be used
Types ¶
type Numbers ¶
type Numbers interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.