I copied and pasted the hello.go source into an editor.
By accident I pressed the return key. This placed
the “{” on the line below the “func main()” line.
When I ran the “go build hello.go” command I
received an error message “missing function body”.
I only realized that I had made this change, and fixed it.
However, I like to place the “{” and “}” characters on separate
lines (column aligned), So I can see if I am missing one of the
characters. Is the placing of the “{” a requirement of the go
language? Is there an “escape” character that allows the line
to continue onto the next line?
Also, in the past I have found that I tend to miss placing a
comma at the end of a line with the next arguement on a
separate line. So I like to start the next line with the comma,
rather than ending the previous line with a comma. In this
way I can add another entry to an argument even at the end of the list without having to go up and add the missing comma. The only
exception is adding a new first entry. And I can easily see if I
have missed a comma, since it is at the beginning of the line.
Is this going to be a problem as well?
go