Skip to content

Commit

Permalink
fix: bool conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Schuetz <thomas.schuetz@t-sc.eu>
  • Loading branch information
thschue committed Apr 13, 2023
1 parent 6b63027 commit 336ec2a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"github.com/k8sgpt-ai/k8sgpt/pkg/analysis"
"net/http"
"os"
"strconv"
"strings"
)

type Config struct {
Expand Down Expand Up @@ -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
}

0 comments on commit 336ec2a

Please sign in to comment.