From e1ead145fc734fc329364b66a2db2bef15bb9721 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 6 Dec 2022 13:22:32 +0100 Subject: [PATCH] cmd/list: Rename a variable for ease of grepping It's better to avoid single letter variables in general, because they are so hard to grep for. This will make the subsequent commit easier to read. https://github.com/containers/toolbox/pull/1190 --- src/cmd/list.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmd/list.go b/src/cmd/list.go index 306c736..7e432b0 100644 --- a/src/cmd/list.go +++ b/src/cmd/list.go @@ -302,7 +302,7 @@ func listOutput(images []toolboxImage, containers []toolboxContainer) { } } -func (i *toolboxImage) UnmarshalJSON(data []byte) error { +func (image *toolboxImage) UnmarshalJSON(data []byte) error { var raw struct { ID string Names []string @@ -314,19 +314,19 @@ func (i *toolboxImage) UnmarshalJSON(data []byte) error { return err } - i.ID = raw.ID - i.Names = raw.Names + image.ID = raw.ID + image.Names = raw.Names // Until Podman 2.0.x the field 'Created' held a human-readable string in // format "5 minutes ago". Since Podman 2.1 the field holds an integer with // Unix time. Go interprets numbers in JSON as float64. switch value := raw.Created.(type) { case string: - i.Created = value + image.Created = value case float64: - i.Created = utils.HumanDuration(int64(value)) + image.Created = utils.HumanDuration(int64(value)) } - i.Labels = raw.Labels + image.Labels = raw.Labels return nil }