Check for nil rather than length
This commit is contained in:
parent
a88177fbf9
commit
99698737d9
|
@ -57,7 +57,7 @@ func (_ *prettyFormatter) Format(info *OutputFormat) (string, error) {
|
|||
fmt.Fprintf(tw, "\n %s\t%s\t%s\t", "----", "----", "----")
|
||||
fmt.Fprintf(tw, "\n Total\t\t%s\t", ByteSize(uint64(info.TotalSize)))
|
||||
|
||||
if len(info.StatsKV) > 0 {
|
||||
if info.StatsKV != nil {
|
||||
fmt.Fprintf(tw, "\n")
|
||||
fmt.Fprintln(tw, "\n Key Name\tCount\tSize\t")
|
||||
fmt.Fprintf(tw, " %s\t%s\t%s\t", "----", "----", "----")
|
||||
|
|
|
@ -199,7 +199,7 @@ func generateStats(info SnapshotInfo) []typeStats {
|
|||
}
|
||||
|
||||
func generateKVStats(info SnapshotInfo) []typeStats {
|
||||
if len(info.StatsKV) > 0 {
|
||||
if info.StatsKV != nil {
|
||||
ks := make([]typeStats, 0, len(info.StatsKV))
|
||||
|
||||
for _, s := range info.StatsKV {
|
||||
|
|
Loading…
Reference in New Issue