ToSlice¶
func ToSlice[T any](ptr *T) []T
ToSlice converts a pointer to a slice. Returns an empty slice if ptr is nil, otherwise returns a slice with the single element.
func ToSlice[T any](ptr *T) []T
ToSlice converts a pointer to a slice. Returns an empty slice if ptr is nil, otherwise returns a slice with the single element.