MCPcopy
hub / github.com/docker/compose / StringToBool

Function StringToBool

pkg/utils/stringutils.go:25–32  ·  view source on GitHub ↗

StringToBool converts a string to a boolean ignoring errors

(s string)

Source from the content-addressed store, hash-verified

23
24// StringToBool converts a string to a boolean ignoring errors
25func StringToBool(s string) bool {
26 s = strings.ToLower(strings.TrimSpace(s))
27 if s == "y" {
28 return true
29 }
30 b, _ := strconv.ParseBool(s)
31 return b
32}

Callers 8

LoadProjectMethod · 0.92
ConfirmMethod · 0.92
upCommandFunction · 0.92
ToModelMethod · 0.92
killCommandFunction · 0.92
runCommandFunction · 0.92
downCommandFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected