X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vendor%2Fgopkg.in%2Fyaml.v2%2Fyaml.go;h=bf18884e0e3ae3921a6ebc2ca1c20056a90de603;hb=f2cbe790a5c3c3e8cb59b592c252b2b84025bd91;hp=36d6b883a6c0ba97ce3f7fe5d1c5c50ed345d390;hpb=13ab652c89a8bf5b16017156f8fb388e1889a8e1;p=govpp.git diff --git a/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/gopkg.in/yaml.v2/yaml.go index 36d6b88..bf18884 100644 --- a/vendor/gopkg.in/yaml.v2/yaml.go +++ b/vendor/gopkg.in/yaml.v2/yaml.go @@ -77,8 +77,19 @@ type Marshaler interface { // supported tag options. // func Unmarshal(in []byte, out interface{}) (err error) { + return unmarshal(in, out, false) +} + +// UnmarshalStrict is like Unmarshal except that any fields that are found +// in the data that do not have corresponding struct members will result in +// an error. +func UnmarshalStrict(in []byte, out interface{}) (err error) { + return unmarshal(in, out, true) +} + +func unmarshal(in []byte, out interface{}, strict bool) (err error) { defer handleErr(&err) - d := newDecoder() + d := newDecoder(strict) p := newParser(in) defer p.destroy() node := p.parse()