Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
gofmt return multiple function closures
63 views
Skip to first unread message
Neehar Vijay
unread,
Feb 19, 2021, 9:46:56 AM
2/19/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
See attachment.
I tried returning two closures from one function, but gofmt formats it oddly.
It looks fine with a tab width of 4 (like go-tour), but it looks hideous with
a tab width of 8.
Is this intentional? Does gofmt assume tab width of 4 or 8?
main.go
Jan Mercl
unread,
Feb 19, 2021, 10:11:12 AM
2/19/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Neehar Vijay, golang-nuts
On Fri, Feb 19, 2021 at 3:46 PM Neehar Vijay <
neeharv...@gmail.com
> wrote:
> Is this intentional? Does gofmt assume tab width of 4 or 8?
No.
Does this look better?
https://play.golang.org/p/0NnZmegKVAu
Ie. just add a line break between the return values. Gofmt will keep
yout choice.
Wojciech S. Czarnecki
unread,
Feb 19, 2021, 10:20:53 AM
2/19/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
Dnia 2021-02-19, o godz. 05:52:38
Neehar Vijay <
neeharv...@gmail.com
> napisał(a):
> Does gofmt assume tab width of 4 or 8?
Gofmt uses ascii tab characters.
It is up to readers to set tabs width as they please.
Hope this helps,
--
Wojciech S. Czarnecki
<< ^oo^ >> OHIR-RIPE
Reply all
Reply to author
Forward
0 new messages