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

cmd/compile: assignment pluralization grammatical error #31099

Closed
nobozo opened this issue Mar 28, 2019 · 6 comments
Closed

cmd/compile: assignment pluralization grammatical error #31099

nobozo opened this issue Mar 28, 2019 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@nobozo
Copy link

nobozo commented Mar 28, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jonf/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jonf/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build622067500=/tmp/go-build -gno-record-gcc-switches"

What 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

@agnivade
Copy link
Contributor

agnivade commented Mar 28, 2019

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

@agnivade agnivade changed the title Funny Minor Error Messsage Grammar Problem cmd/compile: assignment mismatch grammatical error Mar 28, 2019
@griesemer
Copy link
Contributor

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.

@griesemer griesemer added this to the Unplanned milestone Mar 28, 2019
@agnivade agnivade added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 28, 2019
@beoran
Copy link

beoran commented Mar 28, 2019

May I reccomend https://github.com/jinzhu/inflection
JinZhu wrote a nice inflection library which is MIT licensed and at the cost of less than 300 lines of code, you can have plurals for English. With this permission, you could add this to the Go standard library, and then the compiler can be made to emit grammatically correct English plurals easily.

@mdempsky
Copy link
Member

@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.

@beoran
Copy link

beoran commented Apr 4, 2019

Fair enough, if there's only that few words. You could always import that library later if more plurals become necessary.

@odeke-em odeke-em changed the title cmd/compile: assignment mismatch grammatical error cmd/compile: assignment pluralization grammatical error Oct 17, 2019
@mdempsky
Copy link
Member

mdempsky commented Jan 3, 2021

This is fixed by 396b6c2 on dev.regabi.

@mdempsky mdempsky closed this as completed Jan 3, 2021
@golang golang locked and limited conversation to collaborators Jan 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants