xutil

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deduplication added in v0.1.11

func Deduplication[T comparable](l []T) []T

Deduplication 数组去重

func FillObj added in v0.1.15

func FillObj(s, t any) error

FillObj 使用 s 填充 t 对象但排除零值

func IsContains added in v0.1.11

func IsContains[T comparable](v T, vals []T) bool

IsContains 判断是否为数组成员

func IsSubPath

func IsSubPath(parentPath, subPath string) bool

IsSubPath 判断是否为子路径

func IsUsername added in v0.1.9

func IsUsername(s string) bool

IsUsername 判断是否为用户名

func IsZero added in v0.1.11

func IsZero[T comparable](vals ...T) bool

IsZero 判断可比较类型否为非零

func IsZeroOfRefVal added in v0.1.15

func IsZeroOfRefVal(vals ...reflect.Value) bool

IsZeroOfRefVal 判断反射类型是否为零值

func PtrTo

func PtrTo[T any](v T) *T

PtrTo 把值转为指针

func RemoveError added in v0.1.13

func RemoveError[T any](data T, err error) T

RemoveError 去除错误返回

func StructDeduplication added in v0.1.18

func StructDeduplication[T comparable](l []T, uqField string) []T

StructDeduplication 结构体类型数组去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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