MCPcopy Create free account
hub / github.com/github/gh-aw / ParseBoolFromConfig

Function ParseBoolFromConfig

pkg/workflow/config_helpers.go:145–154  ·  view source on GitHub ↗

NOTE: parseExpiresFromConfig and parseRelativeTimeSpec have been moved to time_delta.go to consolidate all time parsing logic in a single location. These functions are used for parsing expiration configurations in safe output jobs. ParseBoolFromConfig is a generic helper that extracts and validates

(m map[string]any, key string, debugLog *logger.Logger)

Source from the content-addressed store, hash-verified

143// Returns the boolean value, or false if not present or invalid.
144// If log is provided, it will log the extracted value for debugging.
145func ParseBoolFromConfig(m map[string]any, key string, debugLog *logger.Logger) bool {
146 if debugLog != nil {
147 debugLog.Printf("Parsing %s from config", key)
148 }
149 result := typeutil.ParseBool(m, key)
150 if debugLog != nil {
151 debugLog.Printf("Parsed %s from config: %t", key, result)
152 }
153 return result
154}
155
156// unmarshalConfig unmarshals a config value from a map into a typed struct using YAML.
157// This provides type-safe parsing by leveraging YAML struct tags on config types.

Callers 2

resolveInlinedImportsFunction · 0.85
TestParseBoolFromConfigFunction · 0.85

Calls 2

ParseBoolFunction · 0.92
PrintfMethod · 0.45

Tested by 1

TestParseBoolFromConfigFunction · 0.68