Skip to content

Commit

Permalink
[chore] [cmd/mdatagen] Remove unused (md *metadata) Unmarshal func (#…
Browse files Browse the repository at this point in the history
…23575)

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
  • Loading branch information
mackjmr authored Jun 20, 2023
1 parent b726aee commit 200778b
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions cmd/mdatagen/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 200778b

Please sign in to comment.