utils

package
v3.0.15 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](items []T, element T) bool

Contains - checks if element exists in the slice.

func DocList

func DocList(items []string) string

func Filter

func Filter[T any](items []T, ok func(item T) bool) []T

Filter - filter down the elements from the given array that pass the test implemented by the provided function.

func MakeLookupMap

func MakeLookupMap[T comparable](items []T) map[T]bool

MakeLookupMap - creates lookup map from slice.

func MakeStringSet added in v3.0.13

func MakeStringSet(values []string) types.Set

func Map

func Map[T, R any](items []T, f func(item T) R) []R

Map - transform giving slice of items by applying the func.

func MapKeys

func MapKeys[T comparable](lookup map[T]bool) []T

MapKeys - collects map keys to slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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