ds

package
v0.0.0-...-4b42cdd Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT, Unlicense Imports: 1 Imported by: 0

Documentation

Overview

ds provides data structure helper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureFilled

func EnsureFilled[T any, PT *T](ts []PT)

EnsureFilled accepts a slice of pointers and allocates a zero value for any element that is nil.

func EnsureFilledSize

func EnsureFilledSize[T any, PT *T](ts []PT, size int) []PT

EnsureFilledSize accepts a slice of pointers, resizes it to ensure it has length at least size, and allocates zero values for any nil elements.

func EnsureSize

func EnsureSize[T any](ts []T, size int) []T

EnsureSize grows the provided slice to ensure it has length size and returns the result. It may or may not have capacity greater than size.

Types

This section is empty.

Jump to

Keyboard shortcuts

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