Merge pull request #58 from aykhans/hotfix/maxuint

🚑 Replace 'math.MaxUint32' with static variable
This commit is contained in:
Aykhan Shahsuvarov 2024-12-18 23:47:53 +04:00 committed by GitHub
commit 77ddcf722a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,6 @@ package readers
import (
"flag"
"fmt"
"math"
"strings"
"github.com/aykhans/dodo/config"
@ -113,9 +112,10 @@ func CLIConfigReader() (*config.CLIConfig, error) {
case "requests-count", "r":
cliConfig.RequestCount = requestsCount
case "timeout", "t":
if timeout > math.MaxUint32 {
utils.PrintfC(utils.Colors.Yellow, "timeout value is too large, setting to %d\n", math.MaxUint32)
timeout = math.MaxUint32
var maxUint32 uint = 4294967295
if timeout > maxUint32 {
utils.PrintfC(utils.Colors.Yellow, "timeout value is too large, setting to %d\n", maxUint32)
timeout = maxUint32
}
cliConfig.Timeout = uint32(timeout)
case "no-proxy-check":