values

package
v0.0.0-...-7b44a9b Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](list []T, v T) bool

func Default

func Default[T any](values []T, def T) (t T)

func Identities

func Identities[T Identifier](v ...T) []int64

func Iterate

func Iterate[T any](list []T, f func(v T))

func IterateX

func IterateX[A, B any](list []A, f func(v A) B) []B

func NumbersTo

func NumbersTo[A, B Number](from []A) []B

func ParseFloat

func ParseFloat[T Float](s string) T

func ParseInteger

func ParseInteger[T Integer](s string) T

func ParseUInteger

func ParseUInteger[T UInteger](s string) T

func StringIdentities

func StringIdentities[T StringIdentifier](v ...T) []string

func Strings

func Strings[T fmt.Stringer](list []T) []string

func Then

func Then[T any](then bool, a, b T) T

func ThenAny

func ThenAny[T any](then, a, b any) T

func ThenFunc

func ThenFunc[T any](then bool, a, b func() T) T

func ThenSet

func ThenSet[T any](then bool, set func() T) T

func ThenSetAny

func ThenSetAny[T any](then bool, set any) T

Types

type Float

type Float interface {
	float32 | float64
}

type Identifier

type Identifier interface {
	// IdentityIc40tk get the id, 'Ic40tk' is used to avoid name conflict
	IdentityIc40tk() int64
}

type Integer

type Integer interface {
	int | int8 | int16 | int32 | int64
}

type Number

type Number interface {
	Integer | UInteger | Float
}

type StringIdentifier

type StringIdentifier interface {
	// IdentityLMhIA1 get the id, 'LMhIA1' is used to avoid name conflict
	IdentityLMhIA1() string
}

type UInteger

type UInteger interface {
	uint | uint8 | uint16 | uint32 | uint64
}

Jump to

Keyboard shortcuts

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