MCPcopy
hub / github.com/lonng/nano / Serialize

Function Serialize

internal/message/util.go:25–34  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

23import "github.com/lonng/nano/internal/env"
24
25func Serialize(v interface{}) ([]byte, error) {
26 if data, ok := v.([]byte); ok {
27 return data, nil
28 }
29 data, err := env.Serializer.Marshal(v)
30 if err != nil {
31 return nil, err
32 }
33 return data, nil
34}

Callers 7

MulticastMethod · 0.92
BroadcastMethod · 0.92
PushMethod · 0.92
RPCMethod · 0.92
ResponseMidMethod · 0.92
RPCMethod · 0.92
writeMethod · 0.92

Calls 1

MarshalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…