|
@@ -6,7 +6,7 @@ import (
|
|
|
|
|
|
type RawMessage []byte
|
|
|
|
|
|
-// MarshalJSON 自定义 json.RawMessage 默认行为
|
|
|
+// MarshalJSON: Customize json.RawMessage default behavior
|
|
|
func (m RawMessage) MarshalJSON() ([]byte, error) {
|
|
|
if len(m) == 0 {
|
|
|
return []byte("null"), nil
|
|
@@ -14,7 +14,7 @@ func (m RawMessage) MarshalJSON() ([]byte, error) {
|
|
|
return m, nil
|
|
|
}
|
|
|
|
|
|
-// UnmarshalJSON sets *m to a copy of data.
|
|
|
+// UnmarshalJSON: sets *m to a copy of data.
|
|
|
func (m *RawMessage) UnmarshalJSON(data []byte) error {
|
|
|
if m == nil {
|
|
|
return errors.New("json.RawMessage: UnmarshalJSON on nil pointer")
|