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"
"net/http"
"os"
"strconv"
"strings"
)
type Config struct {
@@ -67,8 +69,10 @@ func (s *Config) Serve() error {
}
func getBoolParam(param string) bool {
if param == "true" {
return true
b, err := strconv.ParseBool(strings.ToLower(param))
if err != nil {
// Handle error if conversion fails
return false
}
return false
return b
}