Thanks, got to know that "true" and "false" can be a variable name or label. Here is another version.
package main import ( "fmt" ) func isEven(v int) bool { false := !true if (v % 2) == 1 { goto true } return true true: return false } func main() { fmt.Println(isEven(2020)) }
That's cool
Some comments have been hidden by the post's author - find out more
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks, got to know that "true" and "false" can be a variable name or label. Here is another version.
That's cool