It is recommended to modify gofmt to allow short if statement blocks to be written on a single line.
func test(v int) {
if v == 0 { return }
fmt.Println(“v is large then 0”)
}
It is recommended to modify gofmt to allow short if statement blocks to be written on a single line.
func test(v int) {
if v == 0 { return }
fmt.Println(“v is large then 0”)
}
While I like the idea, I think gofmt
tries to be unconfigurable so that everyone has the same formatting.
simplicity and consistency is very important
I think that it is the core value from Go’s point of view.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.