Recommendations regarding the gofmt

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”)
}

1 Like

While I like the idea, I think gofmt tries to be unconfigurable so that everyone has the same formatting.

2 Likes

simplicity and consistency is very important
I think that it is the core value from Go’s point of view.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.