utils

package
v0.0.0-...-4ef2b62 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: GPL-3.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LevelTrace = slog.Level(-8)

Functions

func Capital

func Capital(s string) string

func CapitalEach

func CapitalEach(s string) string

func CastSlice

func CastSlice[T any](s []interface{}) []T

func CopyMap

func CopyMap[K comparable, V any](s map[K]V) map[K]V

func CopySlice

func CopySlice[T any](s []T) []T

func Float

func Float(s string) float64

func FloorTo

func FloorTo(n float64, places int) float64

func GetOr

func GetOr[V any](m any, key string, or V) V

func Has

func Has[K comparable, V any](m map[K]V, key K) bool

func HasTrue

func HasTrue[K comparable, V any](m map[K]V, key K) bool

func Int

func Int(s string) int

func Interface

func Interface(data any) interface{}

func MapConcat

func MapConcat[T comparable, M any](maps ...map[T]M) map[T]M

func MissingOrFalse

func MissingOrFalse[K comparable, V any](m map[K]V, key K) bool

func ModF

func ModF(n float64) float64

func Number

func Number[T numberLike](val any) T

func Or

func Or(val *mod.ModValueMulti, or float64) float64

func OrDefault

func OrDefault(n float64, def float64) float64

func OrF

func OrF(a float64, b float64) float64

func OrNil

func OrNil(n *float64, def float64) float64

func OrS

func OrS(a string, b string) string

func Ptr

func Ptr[T any](a T) *T

func RoundTo

func RoundTo(n float64, places int) float64

func Set

func Set(m any, key string, value any)

func Ternary

func Ternary[T any](cond bool, ifTrue T, ifFalse T) T

func UnwrapOrF

func UnwrapOrF(f *float64, or float64) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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