From 5f2896d4a701352ebe721f916ad10c72b3db206e Mon Sep 17 00:00:00 2001 From: Joel Watson Date: Tue, 10 Nov 2020 16:40:12 -0600 Subject: [PATCH] Add more func comments --- command/snapshot/inspect/snapshot_inspect.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/snapshot/inspect/snapshot_inspect.go b/command/snapshot/inspect/snapshot_inspect.go index 426988301..61a641cf5 100644 --- a/command/snapshot/inspect/snapshot_inspect.go +++ b/command/snapshot/inspect/snapshot_inspect.go @@ -172,6 +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. func generateStats(info SnapshotInfo) []typeStats { ss := make([]typeStats, 0, len(info.Stats)) @@ -184,6 +186,8 @@ 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. func generateKVStats(info SnapshotInfo) []typeStats { if info.StatsKV != nil { ks := make([]typeStats, 0, len(info.StatsKV)) @@ -269,6 +273,8 @@ func (c *cmd) enhance(file io.Reader) (SnapshotInfo, error) { } +// kvEnhance populates the struct with all of the snapshot's +// size information for KV data stored in it func (c *cmd) kvEnhance(keyType string, val interface{}, size int, info *SnapshotInfo) { // automatically set kvDetails to true if a depth or filter // is provided. this allows the user to omit the -kvdetails