【Go Specification fix proposal】about ConstSpec = IdentifierList [ [ Type ] "=" ExpressionList ] .

46 views
Skip to first unread message

k.kubo.pri...@gmail.com

unread,
May 31, 2019, 7:52:12 PM5/31/19
to golang-nuts

In Go Language Specification, I saw the definition of const.


ConstDecl      = "const" ( ConstSpec | "(" { ConstSpec ";" } ")" ) .
ConstSpec      = IdentifierList [ [ Type ] "=" ExpressionList ] .
I think, second line might be
ConstSpec      = IdentifierList [ Type ] "=" ExpressionList .
because const declaration cannot omit value.

Jan Mercl

unread,
May 31, 2019, 7:55:14 PM5/31/19
to k.kubo.pri...@gmail.com, golang-nuts
On Fri, May 31, 2019 at 9:52 PM <k.kubo.pri...@gmail.com> wrote:

> because const declaration cannot omit value.

https://play.golang.org/p/gLlHpdpniTg
Reply all
Reply to author
Forward
0 new messages