Hmmm, that’s a pity. I never realized that before. The following Go code

var b bool
…
b |= otherBool

results in a compilation error:

invalid operation: operator | not defined on b (variable of type bool)

I cannot use || for assignments as in ||= according to https://go.dev/ref/spec#Assignment_statements. Instead, I have to write b = b || otherBool like a barbarian. Oh well, probably doesn’t happen all that often, given that I only now run into this after all those many years.

⤋ Read More