List is a helper function to reduce boilerplate when converting slices of database types to slices of codersdk types. Only works if the function takes a single argument.
(list []F, convert func(F) T)
| 8 | // database types to slices of codersdk types. |
| 9 | // Only works if the function takes a single argument. |
| 10 | func List[F any, T any](list []F, convert func(F) T) []T { |
| 11 | return ListLazy(convert)(list) |
| 12 | } |
| 13 | |
| 14 | // ListLazy returns the converter function for a list, but does not eval |
| 15 | // the input. Helpful for combining the Map and the List functions. |