sliceutil

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert[A, B any, S ~[]B](v S) []A

Convert converts a slice of type B to a slice of type A. Convert panics if B cannot be type asserted to type A.

func DeleteVal

func DeleteVal[E any](s []E, v E) []E

DeleteVal deletes the first occurrence of a value in a slice of the type E and returns a new slice without the value.

func Index

func Index[E any](s []E, v E) int

Index returns the index of the first occurrence of v in s, or -1 if not present. Index accepts any type, as opposed to slices.Index, but might panic if E is not comparable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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