MissingField is called when a key-value is present in the document but has no corresponding field in the target.
(node *unstable.Node)
| 54 | // MissingField is called when a key-value is present in the document but has |
| 55 | // no corresponding field in the target. |
| 56 | func (s *strict) MissingField(node *unstable.Node) { |
| 57 | if !s.Enabled { |
| 58 | return |
| 59 | } |
| 60 | s.key.Push(node) |
| 61 | s.missing = append(s.missing, decodeError{ |
| 62 | highlight: keyLocation(node), |
| 63 | key: s.key.Key(), |
| 64 | message: "unknown field", |
| 65 | }) |
| 66 | s.key.Pop(node) |
| 67 | } |
| 68 | |
| 69 | // Error returns the cumulated StrictMissingError for the document, or nil. |
| 70 | func (s *strict) Error(document []byte) error { |
no test coverage detected