1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-06 22:36:25 +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

10
.idea/libraries/Go_SDK.xml generated Normal file
View File

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="Go SDK">
<CLASSES>
<root url="file:///usr/local/go/src" />
</CLASSES>
<SOURCES>
<root url="file:///usr/local/go/src" />
</SOURCES>
</library>
</component>

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)