structutil

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyIsNil

func AnyIsNil(v any) bool

func Bytes2Struct

func Bytes2Struct[T any](data []byte) (T, error)

func BytesArray2Struct

func BytesArray2Struct[T any](data [][]byte) ([]T, error)

func GetMapFiledByName

func GetMapFiledByName(data map[string]interface{}, filed string) (any, bool)

func GetStructFiledByName

func GetStructFiledByName[T any](object T, field string) any

func Struct2Bytes

func Struct2Bytes[T any](v T) ([]byte, error)

func Struct2Map

func Struct2Map[T any](v T) map[string]any

Struct2Map convert struct to map v must be a pointer

func Struct2String

func Struct2String(v any) string

func ValueOfPtr

func ValueOfPtr[T string | int | int64 | int32](ptr *T, defaultVal T) T

Types

This section is empty.

Jump to

Keyboard shortcuts

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