From 39400363045455868b47c9181d0cb83cd1ee0a41 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 25 Jun 2022 21:47:53 +0200 Subject: [PATCH] go(stats): add explanatory comments [skip ci] --- stats/table.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stats/table.go b/stats/table.go index d52893f..728c044 100644 --- a/stats/table.go +++ b/stats/table.go @@ -11,6 +11,7 @@ import ( "gonum.org/v1/gonum/stat" ) +// statsRow represents the header in the table. type statsHdr struct { Algo string BenchFuncName string @@ -19,6 +20,7 @@ type statsHdr struct { Iterations int } +// statsRow represents a single row in the table. type statsRow struct { Min float64 Max float64 @@ -76,6 +78,8 @@ func statsSingleFunc(singleFuncStats []Stats) { } } +// makeTableHdr fills the table header with passed information. +// TODO(me): add checks to assert only valid inputs are passed in. func makeTableHdr( algo, benchFuncName string, dimens, generations, iterations int, @@ -91,6 +95,7 @@ func makeTableHdr( return *hdr } +// newStatsHdr returns a pointer to a newly created statsHdr instance. func newStatsHdr() *statsHdr { return &statsHdr{} }