(o *pb.Posting)
| 109 | } |
| 110 | |
| 111 | func toInt(o *pb.Posting) int { |
| 112 | from := types.Val{ |
| 113 | Tid: types.TypeID(o.ValType), |
| 114 | Value: o.Value, |
| 115 | } |
| 116 | out, err := types.Convert(from, types.StringID) |
| 117 | x.Check(err) |
| 118 | val := out.Value.(string) |
| 119 | a, err := strconv.Atoi(val) |
| 120 | if err != nil { |
| 121 | return 0 |
| 122 | } |
| 123 | return a |
| 124 | } |
| 125 | |
| 126 | func uidToVal(itr *badger.Iterator, prefix string) map[uint64]int { |
| 127 | keys := make(map[uint64]int) |
no test coverage detected