MCPcopy Index your code
hub / github.com/apache/devlake / parseBool

Function parseBool

backend/plugins/q_dev/tasks/s3_data_extractor.go:265–272  ·  view source on GitHub ↗

parseBool extracts a boolean from the field map, returning false if missing or invalid

(fieldMap map[string]string, field string)

Source from the content-addressed store, hash-verified

263
264// parseBool extracts a boolean from the field map, returning false if missing or invalid
265func parseBool(fieldMap map[string]string, field string) bool {
266 value, ok := fieldMap[field]
267 if !ok {
268 return false
269 }
270 trimmed := strings.TrimSpace(strings.ToLower(value))
271 return trimmed == "true" || trimmed == "1" || trimmed == "yes"
272}
273
274// UserDisplayNameResolver interface for resolving user display names
275type UserDisplayNameResolver interface {

Callers 2

TestParseBoolFunction · 0.85
createUserReportDataFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestParseBoolFunction · 0.68