Prepends items to the beginning of a slice. E.g. Prepend([]int{1,2}, 3, 4) = []int{3,4,1,2} Mutates original slice. Intended usage is to reassign the slice result to the input slice.
(slice []T, values ...T)
| 145 | // E.g. Prepend([]int{1,2}, 3, 4) = []int{3,4,1,2} |
| 146 | // Mutates original slice. Intended usage is to reassign the slice result to the input slice. |
| 147 | func Prepend[T any](slice []T, values ...T) []T { |
| 148 | return append(values, slice...) |
| 149 | } |
| 150 | |
| 151 | // Removes the element at the given index. Intended usage is to reassign the result to the input slice. |
| 152 | func Remove[T any](slice []T, index int) []T { |
no outgoing calls
no test coverage detected