MCPcopy
hub / github.com/pocketbase/pocketbase / ToInterfaceSlice

Function ToInterfaceSlice

tools/list/list.go:79–87  ·  view source on GitHub ↗

ToInterfaceSlice converts a generic slice to slice of interfaces.

(list []T)

Source from the content-addressed store, hash-verified

77
78// ToInterfaceSlice converts a generic slice to slice of interfaces.
79func ToInterfaceSlice[T any](list []T) []any {
80 result := make([]any, len(list))
81
82 for i := range list {
83 result[i] = list[i]
84 }
85
86 return result
87}
88
89// NonzeroUniques returns only the nonzero unique values from a slice.
90func NonzeroUniques[T comparable](list []T) []T {

Callers 13

TestToInterfaceSliceFunction · 0.92
FindRecordsByIdsMethod · 0.92
ValidateValueMethod · 0.92
processFilesToDeleteMethod · 0.92
rememberFilesToDeleteMethod · 0.92
toSliceValueMethod · 0.92
FindAllCollectionsMethod · 0.92
ValidateValueMethod · 0.92
field.goFile · 0.92

Calls

no outgoing calls

Tested by 1

TestToInterfaceSliceFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…