From e8a2feaddbf60c2ab5c929b650e518f558f7b55e Mon Sep 17 00:00:00 2001 From: mackjmr Date: Tue, 20 Jun 2023 17:26:33 +0200 Subject: [PATCH] mdatagen: Remove unused (md *metadata) Unmarshal func This func is not used. Because the receiver is the metadata struct, it would need to be called directly. This also tests field Name -- which does not exist anymore (replaced by Type). **Note:** Validation of Type will be done as part of #23424 --- cmd/mdatagen/loader.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmd/mdatagen/loader.go b/cmd/mdatagen/loader.go index 868df8d111a8..a11aea8c453b 100644 --- a/cmd/mdatagen/loader.go +++ b/cmd/mdatagen/loader.go @@ -224,17 +224,6 @@ type metadata struct { ScopeName string `mapstructure:"-"` } -func (md *metadata) Unmarshal(parser *confmap.Conf) error { - if !parser.IsSet("name") { - return errors.New("missing required field: `description`") - } - err := parser.Unmarshal(md, confmap.WithErrorUnused()) - if err != nil { - return err - } - return nil -} - func (md *metadata) Validate() error { var errs error