myconv

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectObj

func DirectObj(a any) any

去掉引用,返回对象本身

func IPV42Long

func IPV42Long(ip string) uint32

func Long2IPV4

func Long2IPV4(ipInt int64) string

func Map2Slice

func Map2Slice[K comparable, V any](mp map[K]V) (ks []K, vs []V)

func StrToNum

func StrToNum[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64](str string) (ret T, err error)

func Struct2Map

func Struct2Map(a any) (map[string]any, error)

func ToAny

func ToAny[T any](i any) (T, error)

func ToBool

func ToBool(i any) (bool, error)

func ToNum

func ToNum[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64](i any) (T, error)

func ToStr

func ToStr(i 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