FromInt converts the given int value into a pb.TaskValue object.
(val int)
| 21 | |
| 22 | // FromInt converts the given int value into a pb.TaskValue object. |
| 23 | func FromInt(val int) *pb.TaskValue { |
| 24 | bs := make([]byte, 8) |
| 25 | binary.LittleEndian.PutUint64(bs, uint64(val)) |
| 26 | return &pb.TaskValue{Val: bs, ValType: pb.Posting_INT} |
| 27 | } |
| 28 | |
| 29 | // ToInt converts the given pb.TaskValue object into an integer. |
| 30 | // Note, this panics if there are not enough bytes in val.Val |
no outgoing calls