slices

package
v0.0.0-...-5d14948 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsMatch

func ContainsMatch[T any](items []T, predicate func(item T) bool) bool

func Filter

func Filter[T any](ss []T, predicate func(item T, i int) bool) []T

Filter returns items for which a predicate is true in a slice.

func Join

func Join[T any](elements []T, separator string) string

Join concatenates elements of a slice into a single string using the specified separator.

func JoinWithAnd

func JoinWithAnd[T any](elements []T) string

func Map

func Map[T any, U any](ss []T, mutator func(item T, i int) U) []U

Map applies a mutating function to all items in a slice.

func RemoveEmptyString

func RemoveEmptyString(ss []string) []string

func Unique

func Unique[T comparable](ss []T) []T

Unique returns unique items in a slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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