From d8af7812b596abc25b3bb7c64a1ad0afaaa58ab6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 26 Aug 2024 13:44:42 +0200 Subject: [PATCH] cli/command/system: remove redundant nil-check (gosimple) cli/command/system/info.go:375:5: S1009: should omit nil check; len() for []github.com/docker/docker/api/types/system.NetworkAddressPool is defined as zero (gosimple) if info.DefaultAddressPools != nil && len(info.DefaultAddressPools) > 0 { ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit cc1d7b7ac97cbc1d82a8ed3c5a4a311483dd0c61) Signed-off-by: Sebastiaan van Stijn --- cli/command/system/info.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/command/system/info.go b/cli/command/system/info.go index aaf597cf897b..742e8df50b78 100644 --- a/cli/command/system/info.go +++ b/cli/command/system/info.go @@ -372,7 +372,7 @@ func prettyPrintServerInfo(streams command.Streams, info *dockerInfo) []error { fprintln(output, " Product License:", info.ProductLicense) } - if info.DefaultAddressPools != nil && len(info.DefaultAddressPools) > 0 { + if len(info.DefaultAddressPools) > 0 { fprintln(output, " Default Address Pools:") for _, pool := range info.DefaultAddressPools { fprintf(output, " Base: %s, Size: %d\n", pool.Base, pool.Size)