From 182333b645e746b286c8f4eb895e26c4b0139463 Mon Sep 17 00:00:00 2001 From: Joel Watson Date: Wed, 11 Nov 2020 11:33:38 -0600 Subject: [PATCH] Fix some minor wording issues --- .changelog/9098.txt | 2 +- command/snapshot/inspect/snapshot_inspect.go | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.changelog/9098.txt b/.changelog/9098.txt index 7eab768344..2963aa754f 100644 --- a/.changelog/9098.txt +++ b/.changelog/9098.txt @@ -1,3 +1,3 @@ ```release-note:feature -cli: snapshot inspect command provides KV space usage breakdown +cli: snapshot inspect command provides KV usage breakdown ``` diff --git a/command/snapshot/inspect/snapshot_inspect.go b/command/snapshot/inspect/snapshot_inspect.go index ff4b8f0594..e0bbd648c2 100644 --- a/command/snapshot/inspect/snapshot_inspect.go +++ b/command/snapshot/inspect/snapshot_inspect.go @@ -172,8 +172,8 @@ type typeStats struct { Count int } -// Generate the stats for the output struct that's -// used to produce the printed output the user sees. +// generateStats formats the stats for the output struct +// that's used to produce the printed output the user sees. func generateStats(info SnapshotInfo) []typeStats { ss := make([]typeStats, 0, len(info.Stats)) @@ -186,8 +186,9 @@ func generateStats(info SnapshotInfo) []typeStats { return ss } -// Generate the KV stats for the output struct that's -// used to produce the printed output the user sees. +// generateKVStats reformats the KV stats to work with +// the output struct that's used to produce the printed +// output the user sees. func generateKVStats(info SnapshotInfo) []typeStats { kvLen := len(info.StatsKV) if kvLen > 0 { @@ -205,7 +206,8 @@ func generateKVStats(info SnapshotInfo) []typeStats { return nil } -// Sort the stat slice +// sortTypeStats sorts the stat slice by size and then +// alphabetically in the case the size is identical func sortTypeStats(stats []typeStats) []typeStats { sort.Slice(stats, func(i, j int) bool { // sort alphabetically if size is equal