mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
Convert if/else to switch for transport name comparison
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
parent
454a1dea45
commit
f1d0ded43c
1 changed files with 3 additions and 2 deletions
|
|
@ -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, ":")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue