Move comments above struct fields.

This commit is contained in:
kgrygiel 2017-04-19 14:10:37 +02:00
parent 61b9783585
commit e4773dacdd
2 changed files with 13 additions and 7 deletions

View File

@ -43,9 +43,12 @@ func NewCircularBuffer(size int) CircularBuffer {
type circularBuffer struct {
buffer []float64
head int // Index of the most recently added element.
capacity int // Max number of elements.
isFull bool // The number of elements in the buffer equals capacity.
// Index of the most recently added element.
head int
// Max number of elements.
capacity int
// The number of elements in the buffer equals capacity.
isFull bool
}
// Head returns a pointer to the most recently added element. The pointer can be

View File

@ -45,9 +45,12 @@ func NewHistogram(options HistogramOptions) Histogram {
// There's no interpolation within buckets (i.e. one sample falls to exactly one
// bucket).
type histogram struct {
options *HistogramOptions // Bucketing scheme.
buckets []float64 // Weight of samples in each bucket.
totalWeight float64 // Weight of samples in all buckets.
// Bucketing scheme.
options *HistogramOptions
// Weight of samples in each bucket.
buckets []float64
// Weight of samples in all buckets.
totalWeight float64
// Index of the first non-empty bucket if there's any. Otherwise index
// of the last bucket.
minBucket int