utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter added in v0.1.0

func Filter[T any](lst []T, predicate func(T) bool) []T

func FilterNil added in v0.3.0

func FilterNil[T any](lst []*T) []*T

func IsKeyword added in v0.0.4

func IsKeyword(s string) bool

func IsNilOrEmpty

func IsNilOrEmpty(val *string) bool

IsNilOrEmpty returns true if the value is nil or equal to the empty value.

func LowerFirstLetter added in v0.0.7

func LowerFirstLetter(s string) string

func Map added in v0.1.0

func Map[T, R any](lst []T, mapper func(T) R) []R

Types

type Set added in v0.3.0

type Set[T comparable] map[T]consts.Empty

func NewSet added in v0.3.0

func NewSet[T comparable](elems ...T) Set[T]

func (Set[T]) Add added in v0.3.0

func (s Set[T]) Add(v T)

func (Set[T]) Has added in v0.3.0

func (s Set[T]) Has(v T) bool

func (Set[T]) Len added in v0.3.0

func (s Set[T]) Len() int

func (Set[T]) ToList added in v0.3.0

func (s Set[T]) ToList() []T

Jump to

Keyboard shortcuts

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