-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/compile: assignment pluralization grammatical error #31099
Comments
Yes, we do not check the no. of variables/values and update the message accordingly. The fix is pretty simple. @griesemer any objections ? Related #30087 |
Let's leave this alone for now. It's probably not the only place, and in the past we have avoided any extra code just to fix the grammar. Maybe at some point we will, but for that I'd rather have a general solution that works everywhere. |
May I reccomend https://github.com/jinzhu/inflection |
@beoran Thanks for the tip. It looks like "variables" and "values" are the only words that potentially need inflection within any Go error messages though, so I think an entire inflection library is probably unnecessary. |
Fair enough, if there's only that few words. You could always import that library later if more plurals become necessary. |
This is fixed by 396b6c2 on dev.regabi. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/7R1_1wboUZ5
What did you expect to see?
/a.go:16:12: assignment mismatch: 2 variables but 1 value
What did you see instead?
./a.go:16:12: assignment mismatch: 2 variable but 1 values
The text was updated successfully, but these errors were encountered: