roaring
Roaring bitmaps in Go (golang)
...For example, we may need to maintain a set of all documents or rows (represented by numerical identifiers) that satisfy some property. Besides adding or removing elements from the set, we need fast functions to compute the intersection, the union, the difference between sets, and so on. To implement a set of integers, a particularly appealing strategy is the bitmap (also called bitset or bit vector).