Documentation ¶ Index ¶ func Prealloc[T any](capacity int) []T Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Prealloc ¶ func Prealloc[T any](capacity int) []T Preallocates a slice of type T of a given length. If the input length is 0 then the returned slice will be nil. We prefer this over `make([]T, 0, length)` because nil is often treated semantically different from an empty slice. Types ¶ This section is empty. Source Files ¶ View all Source files slice.go Click to show internal directories. Click to hide internal directories.