From 6f1bdb7202a551e6b1b578d5d35a4023427e0255 Mon Sep 17 00:00:00 2001 From: Dave Miles Date: Sun, 1 Dec 2019 22:50:50 +0000 Subject: [PATCH] Cope with *container.Memory equal to nil --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ddb1b0c..1c434fb 100644 --- a/main.go +++ b/main.go @@ -180,11 +180,15 @@ func main() { for _, piece := range container.Command { command = append(command, *piece) } + memory := *container.MemoryReservation + if container.Memory != nil { + memory = *container.Memory + } table.Append([]string{ *container.Name, *container.Image, strconv.FormatInt(*container.Cpu, 10), - strconv.FormatInt(*container.Memory, 10), + strconv.FormatInt(memory, 10), strings.Join(command, " "), }) }