mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 19:59:37 -06:00
18 lines
462 B
Go
18 lines
462 B
Go
package msgpack
|
|
|
|
import (
|
|
"github.com/shamaton/msgpack/v2/internal/encoding"
|
|
)
|
|
|
|
// MarshalAsMap encodes data as map format.
|
|
// This is the same thing that StructAsArray sets false.
|
|
func MarshalAsMap(v interface{}) ([]byte, error) {
|
|
return encoding.Encode(v, false)
|
|
}
|
|
|
|
// MarshalAsArray encodes data as array format.
|
|
// This is the same thing that StructAsArray sets true.
|
|
func MarshalAsArray(v interface{}) ([]byte, error) {
|
|
return encoding.Encode(v, true)
|
|
}
|