I very much like things that improve readability.

On Monday, October 26, 2020 at 11:27:23 AM UTC-5 Eric Lindsey wrote:

> Recently, I gofmt'ed a block of code in a file and this is what I ended up 
> with:
>
> embed := &discordgo.MessageEmbed{
>     Color: MembershipEmbedColor,
>     Description: "This collection is empty.\n" +
>         "Send an image or image URL to get started.",
>     Footer: &discordgo.MessageEmbedFooter{Text: "Membership"},
> }
>
> I would suggest that it would be more readable to format it thus:
>
> embed := &discordgo.MessageEmbed{
>     Color:       MembershipEmbedColor,
>     Description: "This collection is empty.\n" +
>                  "Send an image or image URL to get started.",
>     Footer:      &discordgo.MessageEmbedFooter{Text: "Membership"},
> }
>
> This would follow the style of formatting that gofmt uses for struct 
> definitions. Aligning the second line of the continued string would be a 
> special case; I personally haven't seen gofmt do that anywhere else, yet.
>
> I hope this is the right place to file suggestions for gofmt. If not, 
> please send me in the right direction.
>
> Thanks,
> Eric
>

-- 
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/d2adbe67-bb4e-4484-888e-450c83a600fdn%40googlegroups.com.

Reply via email to