MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / ToBool

Function ToBool

task/conversion.go:45–51  ·  view source on GitHub ↗

ToBool converts the given pb.TaskValue object into a boolean.

(val *pb.TaskValue)

Source from the content-addressed store, hash-verified

43
44// ToBool converts the given pb.TaskValue object into a boolean.
45func ToBool(val *pb.TaskValue) bool {
46 if len(val.Val) == 0 {
47 return false
48 }
49 result := ToInt(val)
50 return result != 0
51}
52
53// FromString converts the given string in to a pb.TaskValue object.
54func FromString(val string) *pb.TaskValue {

Callers 1

addCheckPwdMethod · 0.92

Calls 1

ToIntFunction · 0.85

Tested by

no test coverage detected