slices

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllZeros

func AllZeros(s []byte) bool

AllZeros checks whether s contains all zeros. Returns true if s has no elements.

func CollectIndex

func CollectIndex[E any, S []E](s S, idxs ...int) S

CollectIndex returns new slice of shallows copies of s elements with given indexes.

func CountNilsInTwoDimSlice

func CountNilsInTwoDimSlice[T any](s [][]T) int

CountNilsInTwoDimSlice counts nil elements of s.

func IndexCombos

func IndexCombos(n, k int) [][]int

IndexCombos returns all combinations of n indexes taken k.

func Indexes

func Indexes(n int) []int

Indexes returns slices filled with n indexes.

func MaxLen

func MaxLen(s []string) int

MaxLen returns max length in s. Returns 0 if s is empty.

func NilTwoDimSliceElements

func NilTwoDimSliceElements[T any](s [][]T, idxs []int) [][]T

NilTwoDimSliceElements returns clone of ss with nil-ed given indexes.

func RepeatElement

func RepeatElement[E any, S []E](n int, e E) S

RepeatElement returns slice of n shallow copies of e.

func TwoDimSliceElementCount

func TwoDimSliceElementCount[E any](s [][]E) int

TwoDimSliceElementCount returns sum len for ss.

Types

This section is empty.

Jump to

Keyboard shortcuts

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