3 ms·
I was surprised to see literally invalid names in the "bad" section, e.g. "Cannot start with a digit". Why even presenting this if it's rejected by the compiler
by qezz 6mo ago
I was surprised to see literally invalid names in the "bad" section, e.g. "Cannot start with a digit". Why even presenting this if it's rejected by the compiler?
- 0x696C6961 6mo agoThe example with the dash in it confused me as well.
- alexfoo 6mo agoI wondered if you could sneak in some unicode digit but it seems to reject those too: $ go run z.go # command-line-arguments ./z.go:6:2: identifier cannot begin with digit U+0661 '١' ./z.go:7:27: identifier cannot begin with digit U+0661 '١' (I tried a few of them but not all.)
- pphysch 6mo ago"Chat, generate me a table of bad Golang making practices"
- alex_edwards 6mo agoAuthor here. The answer is because I mentioned it as one of the bullet pointed hard-rules, and I wanted to include an example to illustrate it.