addressed linting and spelling.

This commit is contained in:
Stephen McQuay 2016-02-25 22:46:42 -08:00
parent fc1f5ce2bc
commit 89425716d1
2 changed files with 4 additions and 4 deletions

4
bps.go
View File

@ -12,7 +12,7 @@ const (
minResolution = 3
)
// BPS calculates bandwith rates.
// BPS calculates bandwidth rates.
//
// Instantiate a BPS using one of the New* functions then feed bytes either via
// BPS.Add, or writing to it (it implements io.Writer). When the accumulated
@ -118,7 +118,7 @@ func (b *BPS) Add(i int64) {
// Rate returns the current rate (bytes / second).
func (b *BPS) Rate() float64 {
b.Lock()
var total int64 = 0
var total int64
for _, b := range b.buckets {
total += b
}

View File

@ -49,7 +49,7 @@ func TestWriter(t *testing.T) {
time.Sleep(2 * time.Second)
for i := 0; i < 100; i++ {
if bw.Rate() > 0 {
t.Errorf("got high rate: got, want 0.0000", bw.Rate())
t.Errorf("got high rate: got %f, want 0.0000", bw.Rate())
}
time.Sleep(9 * time.Millisecond)
}
@ -73,7 +73,7 @@ func TestAdd(t *testing.T) {
time.Sleep(2 * time.Second)
for i := 0; i < 100; i++ {
if bw.Rate() > 0 {
t.Errorf("got high rate: got, want 0.0000", bw.Rate())
t.Errorf("got high rate: got %v, want 0.0000", bw.Rate())
}
time.Sleep(9 * time.Millisecond)
}