Unicode character in error message emitted by the compiler

140 views
Skip to first unread message

cuong.m...@gmail.com

unread,
Sep 9, 2020, 11:16:36 PM9/9/20
to golang-dev
Hi folks,

In https://go-review.googlesource.com/c/go/+/253677, I'm going to change the compiler to emit error message contains unicode character. That apply for composite literals, e.g:

    []string literal does not escape

will now be:

    []string{…} does not escape

That's horizontal ellipsis (U+2026), not triple dot.

Is this change fine? Any object/idea on this?

Thanks.

minux

unread,
Sep 9, 2020, 11:24:22 PM9/9/20
to cuong.m...@gmail.com, golang-dev
I don't see what significant benefit … brings, as compared to using triple dots.

Rob Pike

unread,
Sep 9, 2020, 11:46:20 PM9/9/20
to minux, cuong.m...@gmail.com, golang-dev
This will only cause confusion for those who don't have suitable fonts available, and confusion should be avoided in error messages.

-rob


--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/CA%2Bdb%3Dn0AyhqUjUCVSA_fjL6oTTSQYm6ko116VfEQOgad-x_O5Q%40mail.gmail.com.

Cuong Manh Le

unread,
Sep 9, 2020, 11:47:49 PM9/9/20
to minux, golang-dev
Hi Minux,

> I don't see what significant benefit … brings, as compared to using triple dots.

… is not a Go token, and it's also used in Go spec to to informally denote various enumerations or code snippets. E.g:

func (p T) Lock() { … }
func (p T) Unlock() { … }


Cuong Manh Le

Cuong Manh Le

unread,
Sep 10, 2020, 7:58:39 AM9/10/20
to Rob Pike, minux, golang-dev
Hi Rob, minux,

Thanks for your suggestions, we will use triple dot instead of horizontal ellipsis in error message for literal.

Cheers,
Cuong

Reply all
Reply to author
Forward
0 new messages