Re: [go-nuts] formatting question/issue

2018-04-10 Thread Jan Mercl
On Tue, Apr 10, 2018 at 1:32 AM Alex Dvoretskiy wrote: > Why there is no difference if the last comma exists? Because the language specification allows to omit the last comma before the closing '}': LiteralValue = "{" [ ElementList [ "," ] ] "}" . See:

Re: [go-nuts] formatting question/issue

2018-04-09 Thread Tyler Compton
My understanding is that this is a consequence of the semicolon insertion rules Go uses. The Go parser actually uses semicolons internally, but they are inserted before parsing so that the programmer doesn't have to. Semicolons are added to the end of a line if the line ends with: - an

[go-nuts] formatting question/issue

2018-04-09 Thread Alex Dvoretskiy
Hello Golangnuts, Why there is no difference if the last comma exists? {'A', 'B', 'C', 'E'} or {'A', 'B', 'C', 'E',} both are valid. Sometimes it causes little troubles. For example, the second snippet wouldn't compile, because of different formatting. But these two snippets are identical