Side by side
gofmt vs rustfmt
Both stand on code formatters. Which one you can start free with, which one lets you read the code, and what each costs once you pay.
Free plan LinuxMacWindows
gofmt provides a focused way to format Go source, with options for checking differences and applying transformations. Its documented integrations make it usable alongside several editors and version-control workflows.
Visit gofmt Free plan LinuxMacWindows
rustfmt covers common Rust formatting workflows, including Cargo, editor use, and CI. Keep its comment and macro limitations in mind, and check the toolchain requirement for the version and options you need.
Visit rustfmtThe facts
| gofmt | rustfmt | |
|---|---|---|
| Free plan | Yes | Yes |
| Open source | Not published | Not published |
| Runs on | Linux, Mac, Windows | Linux, Mac, Windows |
| Lowest paid plan | Free or on request | Free or on request |
| Plans published | 1 | 1 |
| Maker | Not published | Not published |
| Website | go.dev | rust-lang.github.io |
| On code formatters | #7 of 22 | #11 of 22 |
gofmt: what it does well
- Free executable included with Go installations.
- Can format directories recursively.
- Options include diffs, simplification, and rewrite rules.
- Documented editor and version-control integrations.
- Supports Linux, macOS, and Windows.
What to know first
- Formats Go programs only.
- Directory processing skips files beginning with a period.
- Default output goes to standard output.
rustfmt: what it does well
- Formats Cargo targets across workspaces
- Reads from stdin and writes to stdout
- Integrations listed for several editors
- CI check mode reports formatting differences
- Free and open source under two licenses
What to know first
- Does not attempt to format comments
- Some macro cases are limited
- Unstable options require nightly and opt-in
- Latest version requires nightly
Alternatives to gofmt Alternatives to rustfmt The whole list