Skip to content

Commit

Permalink
cli/command/system: remove redundant nil-check (gosimple)
Browse files Browse the repository at this point in the history
    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 <[email protected]>
(cherry picked from commit cc1d7b7)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Aug 26, 2024
1 parent f042ddb commit d8af781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/command/system/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d8af781

Please sign in to comment.