Decode decodes the document using the given Decoder.
(dec Decoder)
| 177 | |
| 178 | // Decode decodes the document using the given Decoder. |
| 179 | func (d Document) Decode(dec Decoder) error { |
| 180 | if d.m != nil { |
| 181 | return decodeMap(reflect.ValueOf(d.m), dec) |
| 182 | } |
| 183 | return decodeStruct(d.s, dec) |
| 184 | } |
| 185 | |
| 186 | // HasField returns whether or not d has a certain field. |
| 187 | func (d Document) HasField(field string) bool { |