func isOdd(n int) bool {
var odd bool
for i := 0; i < n; i++ {
odd = !odd
}
return odd
}
Playground link: https://go.dev/play/p/8TIfzGrdWDFI did not profile this one yet. But my intuition, and my industry experience, tell me that this is fast.