(id uint64)
| 567 | } |
| 568 | |
| 569 | func encodeID(id uint64) ([]byte, error) { |
| 570 | var ( |
| 571 | buf [binary.MaxVarintLen64]byte |
| 572 | idEncoded = buf[:] |
| 573 | ) |
| 574 | idEncoded = idEncoded[:binary.PutUvarint(idEncoded, id)] |
| 575 | |
| 576 | if len(idEncoded) == 0 { |
| 577 | return nil, fmt.Errorf("failed encoding id = %v", id) |
| 578 | } |
| 579 | return idEncoded, nil |
| 580 | } |
| 581 | |
| 582 | func readID(bkt *bolt.Bucket) uint64 { |
| 583 | id, _ := binary.Uvarint(bkt.Get(bucketKeyID)) |
no outgoing calls
searching dependent graphs…