Is there a way to convert integers to bools in go or vice versa?
Int to bool is easy, just x != 0 will do the trick. To go the other way, since Go doesn’t support a ternary operator, you’d have to do: var x int if b { x = 1 } else { x = 0 } You could of course put this in a function: func … Read more