Skip to content

Commit c2c7bbe

Browse files
BigGold1310negz
andcommitted
Simplify error handling
Simplify error handling by directly returning the error Co-authored-by: Nic Cope <[email protected]> Signed-off-by: Cyrill Näf <[email protected]>
1 parent 565af23 commit c2c7bbe

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

resource/composed/composed.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ func To[T runtime.Object](un *Unstructured, obj T) error {
6363
return errors.Errorf("GVK %v is not known by the scheme for the provided object type", un.GetObjectKind().GroupVersionKind())
6464
}
6565

66-
err = runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, obj)
67-
if err != nil {
68-
return err
69-
}
70-
return nil
66+
return runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, obj)
7167
}
7268

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

0 commit comments

Comments
 (0)