sliceutils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find added in v0.2.6

func Find[T comparable](slice []T, elem T) int

Find returns, given a slice and an element, the first index of elem in the slice, or -1 if the slice does not contain elem.

func ShallowClone added in v0.2.6

func ShallowClone[T any](in []T) []T

ShallowClone clones a slice, creating a new slice and copying the contents of the underlying array. If `in` is a nil slice, a nil slice is returned. If `in` is an empty slice, an empty slice is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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