Go requires every line to end in semi-colons if you look at the EBNF in the specification, but the compiler will insert them for you. It's kind of a subtle detail, but it shows up in some places, for example the following being a compile error:
if true {
}
else {
}
Because the semicolon is inserted when the last character on a line is "one of the operators and punctuation ++, --, ), ], or }" (among other cases, see https://go.dev/ref/spec#Semicolons). So you need to use the } else { style.
In practice, you can just leave of the semicolons at the end of lines (gofmt will remove them) and it's as if semicolons are not required, but if you want to get all technical about it then they are required.
In practice, you can just leave of the semicolons at the end of lines (gofmt will remove them) and it's as if semicolons are not required, but if you want to get all technical about it then they are required.