```go
package main
import (
)
func main(){
a:=1
if a > 0 { return }
}
```
比如 像上面 的 { return }就没报错。不是说要求 花括号换行么
> One consequence of the semicolon insertion rules is that you cannot put the opening brace of a control structure (`if`, `for`, `switch`, or `select`) on the next line. If you do, a semicolon will be inserted before the brace, which could cause unwanted effects.
#4
更多评论
```go
func TestName(t *testing.T) {
testF := func()
{
}
if 1 == 1
{
}
}
```
go 不允许`{`换行写,例如上述的。`}`都可以。
这处的设计是基于 `{` 在其他语言中通常换行与不换行都行,go强制做了规定。
#1