embed: don't compare uint to any negative number (#11603)

This commit is contained in:
Sahdev Zala 2020-02-10 17:16:57 -05:00 committed by GitHub
parent 4c25efc1f8
commit e5c90ebf90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -561,10 +561,10 @@ func (cfg *Config) Validate() error {
return ErrConflictBootstrapFlags
}
if cfg.TickMs <= 0 {
if cfg.TickMs == 0 {
return fmt.Errorf("--heartbeat-interval must be >0 (set to %dms)", cfg.TickMs)
}
if cfg.ElectionMs <= 0 {
if cfg.ElectionMs == 0 {
return fmt.Errorf("--election-timeout must be >0 (set to %dms)", cfg.ElectionMs)
}
if 5*cfg.TickMs > cfg.ElectionMs {