MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / asBool

Function asBool

cmd/cql-proxy/resolver/resolver.go:519–552  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

517}
518
519func asBool(v interface{}) bool {
520 switch d := v.(type) {
521 case bool:
522 return d
523 case int:
524 return d != 0
525 case int8:
526 return d != 0
527 case int16:
528 return d != 0
529 case int32:
530 return d != 0
531 case int64:
532 return d != 0
533 case uint:
534 return d != 0
535 case uint8:
536 return d != 0
537 case uint16:
538 return d != 0
539 case uint32:
540 return d != 0
541 case uint64:
542 return d != 0
543 case float32:
544 return math.Abs(float64(d)) > 0
545 case float64:
546 return math.Abs(d) > 0
547 case string:
548 return len(d) > 0
549 }
550
551 return false
552}
553
554func isString(v interface{}) bool {
555 _, ok := v.(string)

Callers 2

ResolveProjectionFunction · 0.85
ResolveUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected