opts/throttledevice.go:51:5: SA4003: unsigned values are never < 0 (staticcheck)

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 296297190c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Silvin Lubecki 2019-04-02 11:07:11 +02:00 committed by Sebastiaan van Stijn
parent b71d5e32cd
commit ad7bd8235f
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 0 additions and 3 deletions

View File

@ -48,9 +48,6 @@ func ValidateThrottleIOpsDevice(val string) (*blkiodev.ThrottleDevice, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("invalid rate for device: %s. The correct format is <device-path>:<number>. Number must be a positive integer", val) return nil, fmt.Errorf("invalid rate for device: %s. The correct format is <device-path>:<number>. Number must be a positive integer", val)
} }
if rate < 0 {
return nil, fmt.Errorf("invalid rate for device: %s. The correct format is <device-path>:<number>. Number must be a positive integer", val)
}
return &blkiodev.ThrottleDevice{Path: split[0], Rate: rate}, nil return &blkiodev.ThrottleDevice{Path: split[0], Rate: rate}, nil
} }