ToBool converts the given pb.TaskValue object into a boolean.
(val *pb.TaskValue)
| 43 | |
| 44 | // ToBool converts the given pb.TaskValue object into a boolean. |
| 45 | func 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. |
| 54 | func FromString(val string) *pb.TaskValue { |