1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

Marshal comment

This commit is contained in:
nifei
2017-06-05 19:11:16 +08:00
parent 45bbb40a9f
commit d97f5db769
2 changed files with 14 additions and 0 deletions

View File

@ -81,6 +81,10 @@ func UnmarshalAnyFromString(str string) (Any, error) {
return nil, iter.Error
}
// jsoniterator.Marshal is an adapter to json.Marshal
// Marshal returns the JSON encoding of v, adapts to json/encoding API
func Marshal(v interface{}) ([]byte, error) {
buf := &bytes.Buffer{}
stream := NewStream(buf, 512)