Open ivankatliarchuk opened 1 month ago
I have something like this
in our code
func (t *TestJob) UnmarshalYAML(node *yaml.Node) error { type alias TestJob dataAlias := (*alias)(t) err := node.Decode(&dataAlias) if err != nil { return err } t.SetCapabilities() return nil } func Unmarshalling() { suite := TestSuite{ chartRoute: chartRoute, fromRender: fromRender, } yamlDecoder := yaml.NewDecoder(strings.NewReader(content)) yamlDecoder.KnownFields(true) if err := yamlDecoder.Decode(&suite); err != nil { return &suite, err } }
Related https://github.com/go-yaml/yaml/issues/602#issuecomment-623485602 So there is no way to throw an error in custom unmarshaller if there is an unknown field.
Hi @niemeyer would you access a pull request or project is no longer maintained?
I have something like this
in our code
Related https://github.com/go-yaml/yaml/issues/602#issuecomment-623485602 So there is no way to throw an error in custom unmarshaller if there is an unknown field.