diff --git a/zkclient/settings.go b/zkclient/settings.go index 89e7162..a86cbc6 100644 --- a/zkclient/settings.go +++ b/zkclient/settings.go @@ -298,7 +298,7 @@ func ObtainSettings() (*Settings, error) { if err != nil { return nil, fmt.Errorf("groups: %q: %v", group, err) } - if n == 0 || n > len(groups)+1 { + if n <= 0 || n > len(groups)+1 { return nil, fmt.Errorf("groups: %q: window %d unusable", group, n) } g := &openGroups[n-1]