quipo / statsd

Golang StatsD client
MIT License
164 stars 51 forks source link

checkCount fails if value is zero #52

Open keithwegner opened 3 months ago

keithwegner commented 3 months ago

The checkCount function evaluates if a count is less than or equal to zero, but raises an ErrInvalidCount error that states ""count is less than 0".

https://github.com/quipo/statsd/blob/3d6a5565f3141ac42f8353d97b2c016da2752006/client.go#L348C1-L354C2

func checkCount(c int64) error {
    if c <= 0 {
        return ErrInvalidCount
    }
    return nil
}

checkCount should be evaluating for c < 0. (Zero is OK).