UnmarshalJSON implements the json.Unmarshler interface.
(data []byte)
| 81 | |
| 82 | // UnmarshalJSON implements the json.Unmarshler interface. |
| 83 | func (r *UserPermissionRole) UnmarshalJSON(data []byte) (err error) { |
| 84 | var s string |
| 85 | if err = json.Unmarshal(data, &s); err != nil { |
| 86 | return |
| 87 | } |
| 88 | r.FromString(s) |
| 89 | return |
| 90 | } |
| 91 | |
| 92 | // MarshalJSON implements the json.Marshaler interface. |
| 93 | func (r UserPermissionRole) MarshalJSON() ([]byte, error) { |