Re: [go-nuts] gofmt error formatting suggestion
proposed and declined: https://golang.org/issue/27450 On Wednesday, August 11, 2021 at 11:53:54 AM UTC+2 Ralph Seichter wrote: > * burak serdar: > > > f, err:=os.Open(file); if err!=nil { return err } > > I see no advantage in this kind of formatting. Having separate > statements on separate lines (instead of chained with ';') makes > code easier to read, IMO. > > -Ralph > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e02a429a-42ce-4e7b-b2fe-baf1ddcb6a06n%40googlegroups.com.
Re: [go-nuts] gofmt error formatting suggestion
* burak serdar: > f, err:=os.Open(file); if err!=nil { return err } I see no advantage in this kind of formatting. Having separate statements on separate lines (instead of chained with ';') makes code easier to read, IMO. -Ralph -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/87lf58e29g.fsf%40wedjat.horus-it.com.
[go-nuts] gofmt error formatting suggestion
Here is an idea to make reading code a bit easier: If gofmt can format this: f, err:=os.Open(file) if err!=nil { return err } as: f, err:=os.Open(file); if err!=nil { return err } it would make reading code easier by pushing the error passing code to the right. This formatting would only be used for passing errors without any handling. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAMV2RqrX6ZF85JDV7oNZDM-NwaL%3DAAYXg-oXwS_DSTZwaYd%3DZg%40mail.gmail.com.