From a6cda398664e81186d1dd297b47eaec5c6e6bf50 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Thu, 8 Dec 2016 15:29:05 -0600 Subject: [PATCH] Add comments --- bench/bench.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bench/bench.go b/bench/bench.go index c264b8e58..e75f30f80 100644 --- a/bench/bench.go +++ b/bench/bench.go @@ -140,6 +140,7 @@ func Serial(bs ...Benchmark) Benchmark { } } +// wrapper type to force human-readable JSON output type PrettyDuration time.Duration func (d PrettyDuration) MarshalJSON() ([]byte, error) { @@ -147,6 +148,7 @@ func (d PrettyDuration) MarshalJSON() ([]byte, error) { return []byte("\"" + s + "\""), nil } +// Recursively replaces elements of ugly types with their pretty wrappers func Prettify(m map[string]interface{}) map[string]interface{} { newmap := make(map[string]interface{}) for k, v := range m {