MCPcopy
hub / github.com/pelletier/go-toml / MissingField

Method MissingField

strict.go:56–67  ·  view source on GitHub ↗

MissingField is called when a key-value is present in the document but has no corresponding field in the target.

(node *unstable.Node)

Source from the content-addressed store, hash-verified

54// MissingField is called when a key-value is present in the document but has
55// no corresponding field in the target.
56func (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.
70func (s *strict) Error(document []byte) error {

Callers 1

descendMethod · 0.80

Calls 4

keyLocationFunction · 0.85
PushMethod · 0.80
PopMethod · 0.80
KeyMethod · 0.45

Tested by

no test coverage detected