Hacker News new | ask | show | jobs
by ramenmeal 852 days ago
> note that gofmt doesn't indent, which is the hard part

interesting because for me it's hard to read changelogs of js/ts based repos that are using prettier compared to go repos, I wonder if the indentation is a reason for that. I'm honestly not sure what the author means by that either, gofmt seems to fix indentation for me.

2 comments

Yeah, gofmt does and always has fixed indentation (by tabs, thus avoiding another pointless conversation on teams using it).
If you're reading a PR diff on GitHub you can get it to ignore whitespace diffs by adding ?w=1 to the url - complete lifesaver in this kind of situation.
Also, the white space diffs shouldn't be significant as long as all the files were already properly formatted before the change. If your diffs are including unrelated formatting changes, then you should do a single commit to format all your files. You can also use git-ignore-revs so that this formatting commit won't show up in git blame.