gobKit

package
v2.9.105 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 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 added in v2.8.183

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