From 0f47aaf7bdaba8e9258e9a70bb098d7fbbb0052d Mon Sep 17 00:00:00 2001 From: karo Date: Mon, 28 Apr 2025 12:10:31 +0200 Subject: [PATCH] client: remove unnecessary err check and unused variable ioErr Removes an unnecessary err check where ioErr was never assigned to a value and therefore always nil. Also removes the variable all together since it is now no longer used anywhere. Signed-off-by: karo --- client/incus_images.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/client/incus_images.go b/client/incus_images.go index ebb71dd8e..a0ce1a77b 100644 --- a/client/incus_images.go +++ b/client/incus_images.go @@ -462,7 +462,6 @@ func (r *ProtocolIncus) CreateImage(image api.ImagesPost, args *ImageCreateArgs) } // Prepare the body - var ioErr error var body io.Reader var contentType string if args.RootfsFile == nil { @@ -610,10 +609,6 @@ func (r *ProtocolIncus) CreateImage(image api.ImagesPost, args *ImageCreateArgs) defer func() { _ = resp.Body.Close() }() - if ioErr != nil { - return nil, err - } - // Handle errors response, _, err := incusParseResponse(resp) if err != nil {