Golang specification and emojis

Hello everyone!

So I was foolin’ around in golang playground and I tried the following:

🍍 := "pineapple"
πŸ«“ := "pizza dough"
πŸ… := "tomato" 
πŸ§€ := "cheese"
πŸ– := "ham"

πŸ• := πŸ«“ + πŸ… + πŸ§€ + πŸ– + 🍍

fmt.Println(πŸ•)

And when I clicked on β€œRun”, I beholded astonished the following compilation errors :x:

./prog.go:8:2: invalid character U+1F34D '🍍' in identifier
./prog.go:9:2: invalid character U+1FAD3 'πŸ«“' in identifier
./prog.go:10:2: invalid character U+1F345 'πŸ…' in identifier
./prog.go:11:2: invalid character U+1F9C0 'πŸ§€' in identifier
./prog.go:12:2: invalid character U+1F416 'πŸ–' in identifier
./prog.go:14:2: invalid character U+1F355 'πŸ•' in identifier
./prog.go:14:10: invalid character U+1FAD3 'πŸ«“' in identifier
./prog.go:14:17: invalid character U+1F345 'πŸ…' in identifier
./prog.go:14:24: invalid character U+1F9C0 'πŸ§€' in identifier
./prog.go:14:31: invalid character U+1F416 'πŸ–' in identifier
./prog.go:14:31: too many errors

I would expect an error for adding :pineapple: to the :pizza: … But the thing reports error for the rest of the emojis :man_shrugging:

So my questions are… What does golang have against emojis? What does it have against pizza 🀌? Why emojis are not in the language specification at this point? Should I post a proposal at the golang repo?

Can’t believe there’s no more people talking about this at the moment…

Happy 1st of April y’all!

1 Like

Your emojis don’t meet the qualifications required to be included in an identifier:

You can find what qualifies as a unicode letter here: Unicode Character Categories or https://unicode.org/Public/UNIDATA/UnicodeData.txt

FWIW, your emojis are in category So: Other_Symbol.

Jeff I can’t tell if your humor is so dry I’m not clever enough to pick up on it or if you didn’t remember it’s April 1st. :wink:

2 Likes

I do know it is Apr 1, but I wasn’t sure whether the OP was partly serious.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.