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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-08-26 13:44:42 +02:00
parent 436080b887
commit cc1d7b7ac9
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ func prettyPrintServerInfo(streams command.Streams, info *dockerInfo) []error {
fprintln(output, " Product License:", info.ProductLicense) fprintln(output, " Product License:", info.ProductLicense)
} }
if info.DefaultAddressPools != nil && len(info.DefaultAddressPools) > 0 { if len(info.DefaultAddressPools) > 0 {
fprintln(output, " Default Address Pools:") fprintln(output, " Default Address Pools:")
for _, pool := range info.DefaultAddressPools { for _, pool := range info.DefaultAddressPools {
fprintf(output, " Base: %s, Size: %d\n", pool.Base, pool.Size) fprintf(output, " Base: %s, Size: %d\n", pool.Base, pool.Size)