utils

package
v1.1.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.3.0

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

Contains - checks if element exists in the slice.

func DocList added in v1.1.0

func DocList(items []string) string

func Filter added in v0.2.4

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 added in v0.3.0

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

MakeLookupMap - creates lookup map from slice.

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 added in v0.3.0

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