Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy[T any](opts []T) []T
Copy should be used any time existing options are copied into a new locally scoped set of options. This is to avoid data races and accidental side effects.
func Expand ¶
Expand should be used any time existing options are copied into a new locally scoped set of options and extra space is required. This is to avoid data accidental side effects and undesired reallocations when appending to the new slice. The initialPosition parameter specifies the position in the new slice where the existing options should be copied to. It's assumed that the new slice will at least have a length of initialPosition + len(opts). The trailCapacity parameter specifies the number of additional options that may be appended to the new slice. The new slice will have a capacity of initialPosition + len(opts) + trailCapacity and a length of initialPosition + len(opts).
Types ¶
This section is empty.