In this talk, Francesc Campoy has a slide with Go's 25 keywords, and apparently 5 'secret' keywords.
What are the 5 secret keywords in Go?
break , case , continue , default , else , fallthrough , for , goto , if , range , return , select and switch are used to control flow of code. defer and go are also control flow keywords, but in other specific manners.
Keywords in GoLang: Keywords are reserved words in every language. There are 25 keywords available in the go language.
Keywords or reserved words are: break , default , func , interface , select , case , defer , go , map , struct , chan , else , goto , package , switch , const , fallthrough , if , range , type , continue , for , import , return , var .
The following 5 keywords are ignored:
notwithstanding
thetruthofthematter
despiteallobjections
whereas
insofaras
Yes, really.
Update: As Deleplace notes in the comments, the easter egg keywords have been removed. It looks like this commit took them out during a major parser update. If you try to run a program containing one of these tokens, you'll find they're treated as ordinary identifiers now.
There are some easter egg keywords in the lexer (lex.go) that are not in the official documentation, and hence are ignored by the compiler.
Here they are:
notwithstanding
thetruthofthematter
despiteallobjections
whereas
insofaras
You can report to this conversation for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With