Skip to content

Commit

Permalink
Merge pull request #96 from vimeo/pflag-remove-unnecessary
Browse files Browse the repository at this point in the history
Remove Unnecessary Error from pflag
  • Loading branch information
sergiosalvatore authored Aug 30, 2024
2 parents 2e8ffb1 + ba6d740 commit 5d23ad9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sources/pflag/pflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ func (s *Set) Value(_ context.Context, t *dials.Type) (reflect.Value, error) {
return reflect.Value{}, err
}
}
var setErr error
val := reflect.New(t.Type())

s.Flags.Visit(func(f *pflag.Flag) {
fieldName, ok := s.flagFieldName[f.Name]
if !ok {
Expand Down Expand Up @@ -492,9 +491,6 @@ func (s *Set) Value(_ context.Context, t *dials.Type) (reflect.Value, error) {
ffield.Set(cfval)
}
})
if setErr != nil {
return val.Elem(), setErr
}

return s.tfmr.ReverseTranslate(s.trnslVal)
}
Expand Down

0 comments on commit 5d23ad9

Please sign in to comment.