mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-18 16:34:31 +00:00
fix: bool conversion
Signed-off-by: Thomas Schuetz <thomas.schuetz@t-sc.eu>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user