generics

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As added in v0.3.0

func As[T any](o interface{}) T

func AsE added in v0.3.0

func AsE[T any](o interface{}, err error) (T, error)

func Conditional

func Conditional[T any](cond bool, a, b T) T

func MapKeyArray added in v0.3.0

func MapKeyArray[K comparable, V any](m map[K]V) []K

func MapValues added in v0.3.0

func MapValues[K comparable, V any](m map[K]V) []V

Types

type Set

type Set[K comparable] map[K]struct{}

func KeySet added in v0.2.0

func KeySet[K comparable, V any](m map[K]V) Set[K]

func MapKeys added in v0.3.0

func MapKeys[K comparable, V any](m map[K]V) Set[K]

func NewSet

func NewSet[K comparable](keys ...K) Set[K]

func (Set[K]) Add

func (s Set[K]) Add(keys ...K) Set[K]

func (Set[K]) AsArray added in v0.3.0

func (s Set[K]) AsArray() []K

func (Set[K]) Contains

func (s Set[K]) Contains(keys ...K) bool

func (Set[K]) Delete

func (s Set[K]) Delete(keys ...K) Set[K]

Jump to

Keyboard shortcuts

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