mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-19 18:16:09 +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"
|
"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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user