Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Disclaimer: I don't know Go. This is all just me reading the specification. In the Go specification under Packages, it defines PackageName. PackageName = identifier Under Identifiers identi...
Answer
#2: Post edited
Disclaimer, I don't know Go.- -----
In the Go specification, [Packages](https://golang.org/ref/spec#Packages)- > ```
- > PackageName = identifier
- > ```
- Under [Identifiers](https://golang.org/ref/spec#Identifiers)
- > ```
- > identifier = letter { letter | unicode_digit } .
- > ```
- Under [Letters and digits](https://golang.org/ref/spec#Letters_and_digits)
- > ```
- > letter = unicode_letter | "_" .
- > ```
Finally, under [Characters](https://golang.org/ref/spec#Characters)- > ```
- > unicode_letter = /* a Unicode code point classified as "Letter" */ .
- > unicode_digit = /* a Unicode code point classified as "Number, decimal digit" */ .
- > ```
So it seems according to the specification, any Unicode letter or number, as well as underscores are technically legal.
- Disclaimer: I don't know Go. This is all just me reading the specification.
- -----
- In the Go specification under [Packages](https://golang.org/ref/spec#Packages), it defines `PackageName`.
- > ```
- > PackageName = identifier
- > ```
- Under [Identifiers](https://golang.org/ref/spec#Identifiers)
- > ```
- > identifier = letter { letter | unicode_digit } .
- > ```
- Under [Letters and digits](https://golang.org/ref/spec#Letters_and_digits)
- > ```
- > letter = unicode_letter | "_" .
- > ```
- **Underscores are therefore legal, according to the spec.**
- Under [Characters](https://golang.org/ref/spec#Characters), it says what constitutes a `unicode_letter` and `unicode_digit`.
- > ```
- > unicode_letter = /* a Unicode code point classified as "Letter" */ .
- > unicode_digit = /* a Unicode code point classified as "Number, decimal digit" */ .
- > ```
- > In [The Unicode Standard 8.0](https://www.unicode.org/versions/Unicode8.0.0/), Section 4.5 "General Category" defines a set of character categories. Go treats all characters in any of the Letter categories Lu, Ll, Lt, Lm, or Lo as Unicode letters, and those in the Number category Nd as Unicode digits.
#1: Initial revision
Disclaimer, I don't know Go. ----- In the Go specification, [Packages](https://golang.org/ref/spec#Packages) > ``` > PackageName = identifier > ``` Under [Identifiers](https://golang.org/ref/spec#Identifiers) > ``` > identifier = letter { letter | unicode_digit } . > ``` Under [Letters and digits](https://golang.org/ref/spec#Letters_and_digits) > ``` > letter = unicode_letter | "_" . > ``` Finally, under [Characters](https://golang.org/ref/spec#Characters) > ``` > unicode_letter = /* a Unicode code point classified as "Letter" */ . > unicode_digit = /* a Unicode code point classified as "Number, decimal digit" */ . > ``` So it seems according to the specification, any Unicode letter or number, as well as underscores are technically legal.