From 3b07761116adbb8eefbdf2db3d3727217220742c Mon Sep 17 00:00:00 2001 From: CodeLingo Bot Date: Mon, 18 Feb 2019 11:07:44 +0000 Subject: [PATCH] Fix function comments based on best practices from Effective Go Signed-off-by: CodeLingo Bot --- src/bolt/cmd/bolt/main.go | 8 ++++---- src/bolt/db.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bolt/cmd/bolt/main.go b/src/bolt/cmd/bolt/main.go index b96e6f7..59a17d5 100644 --- a/src/bolt/cmd/bolt/main.go +++ b/src/bolt/cmd/bolt/main.go @@ -1295,7 +1295,7 @@ type BenchResults struct { ReadDuration time.Duration } -// Returns the duration for a single write operation. +// WriteOpDuration returns the duration for a single write operation. func (r *BenchResults) WriteOpDuration() time.Duration { if r.WriteOps == 0 { return 0 @@ -1303,7 +1303,7 @@ func (r *BenchResults) WriteOpDuration() time.Duration { return r.WriteDuration / time.Duration(r.WriteOps) } -// Returns average number of write operations that can be performed per second. +// WriteOpsPerSecond returns average number of write operations that can be performed per second. func (r *BenchResults) WriteOpsPerSecond() int { var op = r.WriteOpDuration() if op == 0 { @@ -1312,7 +1312,7 @@ func (r *BenchResults) WriteOpsPerSecond() int { return int(time.Second) / int(op) } -// Returns the duration for a single read operation. +// ReadOpDuration returns the duration for a single read operation. func (r *BenchResults) ReadOpDuration() time.Duration { if r.ReadOps == 0 { return 0 @@ -1320,7 +1320,7 @@ func (r *BenchResults) ReadOpDuration() time.Duration { return r.ReadDuration / time.Duration(r.ReadOps) } -// Returns average number of read operations that can be performed per second. +// ReadOpsPerSecond returns average number of read operations that can be performed per second. func (r *BenchResults) ReadOpsPerSecond() int { var op = r.ReadOpDuration() if op == 0 { diff --git a/src/bolt/db.go b/src/bolt/db.go index 1223493..52eb23b 100644 --- a/src/bolt/db.go +++ b/src/bolt/db.go @@ -781,7 +781,7 @@ func (db *DB) Stats() Stats { return db.stats } -// This is for internal access to the raw data bytes from the C cursor, use +// Info is for internal access to the raw data bytes from the C cursor, use // carefully, or not at all. func (db *DB) Info() *Info { return &Info{uintptr(unsafe.Pointer(&db.data[0])), db.pageSize}