I’m looking for a clever way to “map” three int-codes and their possible combinations into one field.
Think of something like colors:
red = 1
green = 2
blue = 3
Every color can be picked. I don’t want to use three boolean flags, since I expect large volumes (I want to log this as events)
I can’t just add or multiply the values, because 1 + 2 = 3 (lol obvious) so I wouldn’t know if it was red and green or just blue - hope you know what I mean
It’s not really a GO question, rather general logics. I also want to avoid int/string conversion to “build” a new number like “123” or “12” for performance reasons.
I was thinking of bitmaps/bit-logic or something…not sure - any thoughts?