Repeat Slice Patterns with slices.Repeat in Go
slices.Repeat builds a new slice by concatenating a source slice with itself a specified number of times. The operation is small, but its exact contract matters when code depends on allocation, nil state, or reference-bearing elements. The function belongs to the standard slices package and has this signature: func Repeat[S ~[]E, E any](x S, count int) S The returned slice has both length and capacity equal to len(x) * count. The result is never nil.