Documentation
¶
Index ¶
- Constants
- func Atoi(num string, base int) int64
- func Atoid(num string) int64
- func Contains[T any](items *[]T, item T) bool
- func Flat[T flatType](from T) *flatConverter[T]
- func FormatInt(num int64, base int) string
- func FormatIntd(num int64) string
- func Gid() (id uint64)
- func If[T any](condition bool, result T) (t T)
- func Iff[T any](condition bool, result callback[T]) (t T)
- func Ift[T any](condition bool, first T, second T) (t T)
- func Ifx[T any](condition bool, first callback[T], second callback[T]) (t T)
- func Index[T any](items *[]T, item T) (index int)
- func Set[T any](setter func(value T), first T, second T)
- func StringBuilder(items ...any) (sb *stringBuilder)
- func Ternary[T any](condition bool, first T, second T) (t T)
- func TernaryFunc[T any](condition bool, first callback[T], second callback[T]) (t T)
- func ToString(from any) (to string)
- func ToStrings(from ...any) (to []string)
- type CannotCompare
- type CannotCopy
- type Case
- type Field
- type Fields
- type Key
- type Kv
- type Object
- type Package
- type Size
- type Value
Constants ¶
View Source
const ( // CasePositionNone 无 CasePositionNone casePosition = iota // CasePositionHead 首 CasePositionHead // CasePositionTail 尾 CasePositionTail // CasePositionAll 全部 CasePositionAll )
Variables ¶
This section is empty.
Functions ¶
func Set ¶ added in v0.1.3
func Set[T any](setter func(value T), first T, second T)
Set 设置方法,当`first`值为零值时,设置为`second`的值,否则设置`first`的值
func StringBuilder ¶ added in v0.2.6
func StringBuilder(items ...any) (sb *stringBuilder)
StringBuilder 创建连写字符串
func TernaryFunc ¶ added in v0.2.5
TernaryFunc 模拟三元表达式,主要用法是减少大括号
Types ¶
type Case ¶ added in v0.1.3
type Case string
Case 字符串转换
func (*Case) Underscore ¶ added in v0.1.3
Underscore 转为下划线写法
type Size ¶
type Size int64
Size 字节大小
func (Size) MarshalJSON ¶ added in v0.0.7
func (*Size) UnmarshalJSON ¶ added in v0.0.7
Source Files
¶
Click to show internal directories.
Click to hide internal directories.