func compareBuckets(a, b leakybucket.Bucket) error { if a.Remaining() != b.Remaining() { return fmt.Errorf("first has %d remaining, second has %d remaining", a.Remaining(), b.Remaining()) } return compareBucketTimes(a, b) }
func compareBucketTimes(a, b leakybucket.Bucket) error { if a.Reset().Unix() == b.Reset().Unix() { return nil } return fmt.Errorf("first has %#v reset, second has %#v reset", a.Reset().Unix(), b.Reset().Unix()) }