go-json/json.go

11 lines
174 B
Go

package json
import "bytes"
func Marshal(v interface{}) ([]byte, error) {
var b *bytes.Buffer
enc := NewEncoder(b)
defer enc.release()
return enc.encodeForMarshal(v)
}