Skip to content

Commit

Permalink
Simplify error handling
Browse files Browse the repository at this point in the history
Simplify error handling by directly returning the error

Co-authored-by: Nic Cope <[email protected]>
Signed-off-by: Cyrill Näf <[email protected]>
  • Loading branch information
BigGold1310 and negz committed Nov 13, 2024
1 parent fd57a55 commit 1b77621
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions resource/composed/composed.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ func To[T runtime.Object](un *Unstructured, obj T) error {
return errors.Errorf("GVK %v is not known by the scheme for the provided object type", un.GetObjectKind().GroupVersionKind())
}

err = runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, obj)
if err != nil {
return err
}
return nil
return runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, obj)
}

// From creates a new unstructured composed resource from the supplied object.
Expand Down

0 comments on commit 1b77621

Please sign in to comment.