Thanks to visit codestin.com
Credit goes to github.com

Skip to content

checkCount fails if value is zero #52

@keithwegner

Description

@keithwegner

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions