Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text/scanner: rename AllowNumberbars? #32661

Closed
cespare opened this issue Jun 17, 2019 · 1 comment
Closed

text/scanner: rename AllowNumberbars? #32661

cespare opened this issue Jun 17, 2019 · 1 comment
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker
Milestone

Comments

@cespare
Copy link
Contributor

cespare commented Jun 17, 2019

I was reviewing changes for Go 1.13 and I noticed that a new name "AllowNumberbars" was added to text/scanner:

AllowNumberbars = 1 << -allowNumberbars // if set, number literals may contain underbars as digit separators

We should consider renaming this before the Go 1.13 release for two reasons:

  • Unless "numberbar" is a term of art I'm unaware of, the capitalization doesn't match current Go convention (such as in the name ScanRawStrings a few lines above): it should be AllowNumberBars.

  • The name is derived from underbar as a name for the _ character which is also used in the documentation comment; I believe this usage is uncommon in American English as compared with underscore. Indeed, the updated spec uses underscore:

    For readability, an underscore character _ may appear after a base prefix or between successive digits; such underscores do not change the literal's value.

    So, despite being longer, I think that AllowNumberUnderscores (or AllowNumUnderscores?) would be better.

This name was added in CL 163079 and as far as I can tell, the name hasn't been debated yet. (Apologies if this shed was already painted.)

/cc @griesemer

@cespare cespare added this to the Go1.13 milestone Jun 17, 2019
@dmitshur dmitshur added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jun 17, 2019
@gopherbot
Copy link

Change https://golang.org/cl/183077 mentions this issue: text/scanner: rename AllowNumberbars to AllowDigitSeparators

@golang golang locked and limited conversation to collaborators Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants