Marshal adapts to json/encoding Marshal API. Marshal returns the JSON encoding of v, adapts to json/encoding Marshal API Refer to https://godoc.org/encoding/json#Marshal for more information.
(v any)
| 25 | // Marshal returns the JSON encoding of v, adapts to json/encoding Marshal API |
| 26 | // Refer to https://godoc.org/encoding/json#Marshal for more information. |
| 27 | func Marshal(v any) (marshaledBytes []byte, err error) { |
| 28 | marshaledBytes, err = json.Marshal(v) |
| 29 | if err != nil { |
| 30 | err = gerror.Wrap(err, `json.Marshal failed`) |
| 31 | } |
| 32 | return |
| 33 | } |
| 34 | |
| 35 | // MarshalIndent same as json.MarshalIndent. |
| 36 | func MarshalIndent(v any, prefix, indent string) (marshaledBytes []byte, err error) { |
searching dependent graphs…