From 9623dfd9240a212d0cd1135bfa4be6265c787b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isaac=20Pe=C3=B1a?= Date: Wed, 1 May 2024 23:29:38 +0200 Subject: [PATCH] Add minimum and maximum verbosity values as constants --- hack/ccp/internal/servercmd/cmd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hack/ccp/internal/servercmd/cmd.go b/hack/ccp/internal/servercmd/cmd.go index 87d22d2bb..3556d3163 100644 --- a/hack/ccp/internal/servercmd/cmd.go +++ b/hack/ccp/internal/servercmd/cmd.go @@ -21,6 +21,8 @@ import ( const ( DefaultVerbosity int = 0 + MinimumVerbosity int = 0 + MaximumVerbosity int = 10 ) func (c *Config) RegisterFlags(fs *flag.FlagSet) { @@ -43,7 +45,7 @@ func (c *Config) ConfigureFromEnv() { func parseVerbosity(v string) int { value, err := strconv.Atoi(v) - if err == nil || value < 0 || value > 10 { + if err == nil || value < MinimumVerbosity || value > MaximumVerbosity { return DefaultVerbosity }