Print the file if formatting would change it.
Section: Formatting and source transforms
Preview formatting diff
bash
bash
gofmt -d .Explanation
Print the file if formatting would change it. Useful in Go CLI workflows.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Formatting and source transforms