fix: bool conversion

Signed-off-by: Thomas Schuetz <thomas.schuetz@t-sc.eu>
This commit is contained in:
Thomas Schuetz
2023-04-13 13:13:45 +02:00
parent 6b630275eb
commit 336ec2a426

View File

@@ -6,6 +6,8 @@ import (
"github.com/k8sgpt-ai/k8sgpt/pkg/analysis" "github.com/k8sgpt-ai/k8sgpt/pkg/analysis"
"net/http" "net/http"
"os" "os"
"strconv"
"strings"
) )
type Config struct { type Config struct {
@@ -67,8 +69,10 @@ func (s *Config) Serve() error {
} }
func getBoolParam(param string) bool { func getBoolParam(param string) bool {
if param == "true" { b, err := strconv.ParseBool(strings.ToLower(param))
return true if err != nil {
// Handle error if conversion fails
return false
} }
return false return b
} }