gobKit

package
v3.1.112 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(obj any) ([]byte, error)

Marshal 序列化.

e.g.

var m map[interface{}]interface{} = nil
fmt.Println(gobKit.Marshal(m)) // [13 127 4 1 2 255 128 0 1 16 1 16 0 0 4 255 128 0 0] <nil>

var obj interface{} = nil
fmt.Println(gobKit.Marshal(obj)) // [] gob: cannot encode nil value

func Unmarshal

func Unmarshal(data []byte, ptr interface{}) error

Unmarshal 反序列化.

PS: 反序列化为map实例,key类型可以是interface{}.

func UnmarshalFromReader

func UnmarshalFromReader(reader io.Reader, ptr interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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