valuer

package
v0.0.0-...-69bdcc1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElemOr

func ElemOr[T any](value *T, or T) T

func ExistOr

func ExistOr[T any](value *T, or *T) *T

func Float64ify

func Float64ify(input any) float64

func FormatFloat

func FormatFloat(float float64) string

func If

func If[T any](test bool, ok, no T) T

func Int64Slice

func Int64Slice(input []rune) []int64

Int64Slice 从字符串中提取整数 性能是用正则表达式提取的7倍

func Int64ify

func Int64ify(input any) int64

func ParseFloat

func ParseFloat(input string) float64

func ParseGeneralDate

func ParseGeneralDate(input []rune) time.Time

ParseGeneralDate 解析任意字段有序的日期 顺序必须是:年月日时分秒纳秒,兼容ISO8601UTC时区 时间字段可以是任意分隔符或填充位数,示例如下: 2022年8月21日19点18分38秒123456789纳秒 20220821191838.123456789 2022-8-21T19:18:38.123456789+8:30 2022-8-21 19:18:38Z(可以没有纳秒) 2022-8-21(可以没有时间,甚至可以没有日期)

func ParseInt

func ParseInt(input string) int64

func Ptr

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

func SplitBytes

func SplitBytes(bts []byte, count int) [][]byte

SplitBytes 把byte切片平均分成count个小切片

func Stringify

func Stringify(input any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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