Live data from Hacker News

Gofumpt: A stricter gofmt

github.com

1–10 of 93 posts

Re: Gofumpt: A stricter gofmt

#2
See also:

interfacer - Automatically Suggest Interface Types in Go

https://github.com/mvdan/interfacer

https://news.ycombinator.com/item?id=11397905 (9 comments)

shmfmt - A shell parser, formatter, and interpreter with BASH support

https://github.com/mvdan/sh

(Submitted often but not yet discussed)

---

/me whispers: Hint: You could be that guy [1] (or gal, they, it, etc):

/submit shmfmt

Feel free to leave a link to your submission here for other inquisitive parties to stumble upon.

[1] https://youtube.com/watch?v=HQXTxG8JBAw&t=105s

Transparency: Clip is mildly offensive

Re: Gofumpt: A stricter gofmt

#3
post #2

See also: interfacer - Automatically Suggest Interface Types in Go https://github.com/mvdan/interfacer https://news.ycombinator.com/item?id=11397905 (9 comments) shmfmt - A shell parser, formatter, and interpreter with BASH support https://github.com/mvdan/sh (Submitted often but not yet discussed) --- /me whispers: Hint: You could be that guy [1] (or gal, they, it, etc): /submit shmfmt Feel free to leave a link to y…

Ah well, maybe next time :)

Re: Gofumpt: A stricter gofmt

#6
post #2

See also: interfacer - Automatically Suggest Interface Types in Go https://github.com/mvdan/interfacer https://news.ycombinator.com/item?id=11397905 (9 comments) shmfmt - A shell parser, formatter, and interpreter with BASH support https://github.com/mvdan/sh (Submitted often but not yet discussed) --- /me whispers: Hint: You could be that guy [1] (or gal, they, it, etc): /submit shmfmt Feel free to leave a link to y…

oh awesome thanks for sharing! shfmt works very well so far. i've been using acme for a few weeks and need every formatter i can get :)

https://9fans.github.io/plan9port/man/man1/acme.html

Re: Gofumpt: A stricter gofmt

#7
post #5

gofmt being the official tool avoids bikeshedding over formatting rules. Diverging from the default seems like a step backwards, doesn't it?

In the roadmap section[1] the author says it's more of an experiment with a possibility that some of the rules might end up in the original 'gofmt' tool. While I agree that Go having a de facto formatter built in is wonderful, there are some absolutely fantastic additions in 'gofumpt' that I do hope wind up in 'gofmt'

---

[1]: https://github.com/mvdan/gofumpt#roadmap

Re: Gofumpt: A stricter gofmt

#8
post #7
post #5

gofmt being the official tool avoids bikeshedding over formatting rules. Diverging from the default seems like a step backwards, doesn't it?

In the roadmap section[1] the author says it's more of an experiment with a possibility that some of the rules might end up in the original 'gofmt' tool. While I agree that Go having a de facto formatter built in is wonderful, there are some absolutely fantastic additions in 'gofumpt' that I do hope wind up in 'gofmt' --- [1]: https://github.com/mvdan/gofumpt#roadmap

Ok that sounds great

Re: Gofumpt: A stricter gofmt

#9
post #5

gofmt being the official tool avoids bikeshedding over formatting rules. Diverging from the default seems like a step backwards, doesn't it?

A little yeah, but I think it still raises the base level of effort to nitpick trivial stuff enough to be effective.

Re: Gofumpt: A stricter gofmt

#10

Anyone know if the following exists? Gofmt/gofumpt, but as a special case, formats if err != nil { return err } on a single line. Not trolling, genuinely interested.

I've found that it's almost always a good idea to return fmt.Errorf(...), adding context to the error. Otherwise error messages are too generic and it's hard to figure out what's actually wrong. Then it doesn't fit on a single line anymore.
Post reply on HN