Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That definitely helps, though you can't use it to introduce new variables with the := syntax:

if buf, err := json.Marshal(make(chan int)); err != nil { fmt.Println("Ehh..", err) return }

In this case, buf will not be available outside of the if statement. Go fmt can already leave your insignificant whitespace as is, I just wish it could also leave the if error != nil statement say in one line instead of formatting it to take three.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: