From f1d0ded43cd7a296ee6044781cb94262863af1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Rod=C3=A1k?= Date: Fri, 12 Jun 2026 09:51:58 +0200 Subject: [PATCH] Convert if/else to switch for transport name comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Rodák --- pkg/machine/os/ostree.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/machine/os/ostree.go b/pkg/machine/os/ostree.go index e1108057db..3bf1d7a177 100644 --- a/pkg/machine/os/ostree.go +++ b/pkg/machine/os/ostree.go @@ -236,10 +236,11 @@ func parseApplyInput(arg string) (string, string, error) { } imagePath := imgRef.StringWithinTransport() - if transportName == ociTransport { + switch transportName { + case ociTransport: // oci:/tmp/oci-image imagePath, _, _ = strings.Cut(imagePath, ":") - } else if transportName == ociArchiveTransport { + case ociArchiveTransport: // oci-archive:/tmp/myimage.tar imagePath = strings.TrimSuffix(imagePath, ":") }