Method
decodeString
(v string, rv reflect.Value)
Source from the content-addressed store, hash-verified
| 208 | } |
| 209 | |
| 210 | func (d *decoder) decodeString(v string, rv reflect.Value) error { |
| 211 | switch rv.Kind() { |
| 212 | case reflect.String: |
| 213 | rv.SetString(v) |
| 214 | case reflect.Interface: |
| 215 | rv.Set(reflect.ValueOf(v).Convert(rv.Type())) |
| 216 | default: |
| 217 | return &document.UnmarshalTypeError{Value: "string", Type: rv.Type()} |
| 218 | } |
| 219 | return nil |
| 220 | } |
| 221 | |
| 222 | func (d *decoder) decodeMap(tv cbor.Map, rv reflect.Value) error { |
| 223 | switch rv.Kind() { |
Tested by
no test coverage detected