slice

package
v3.90.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 0 Imported by: 30

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL