I’m just new to learn Go, when I try my first hello world with this style:
func main()
{
...somemagic...
}
and the 6g compiler says that’s wrong.
But with this style:
func main(){
...somemagic...
}
That’s OK.
Is the first bracket pair style illegal in Go?
Yes. That’s a result of automatic semicolon insertion in Go.
By the way, Go developers format their code using
gofmtand follow that formatting.