mirror of https://github.com/docker/cli.git
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>
(cherry picked from commit cc1d7b7ac9
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f042ddb5c9
commit
d8af7812b5
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue