Skip to content
SPECIFICTION
Get listed

dprint vs gofmt

dprint

dprint.dev

gofmt

go.dev

Side by side

Figuredprintgofmt
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WindowsYesYes
macOSYesYes
LinuxYesYes
Self-hostedYes—
Plans published11
Spec score · Code Formatting Tools8.1 (#7)7.8 (#13)
Editor integrationsThe installation guide lists Visual Studio Code, IntelliJ and Neovim integrations, with the dprint language-server command usable by other editors.The Go project documents gofmt integrations for Vim, Emacs, Eclipse, Sublime Text, Git pre-commit hooks, and Mercurial.
LicenseThe dprint GitHub repository is marked MIT licensed.Go is an open source project distributed under a BSD-style license.
PerformanceThe site says dprint formats hundreds of files in milliseconds and uses incremental caching by default.Since Go 1.18, gofmt reads and formats input files concurrently with memory limited proportionally to GOMAXPROCS.
Purposedprint is a command-line application that automatically formats code.Gofmt automatically formats Go programs using tabs for indentation and blanks for alignment.
SecurityWasm plugins run sandboxed without access to the network or file system.The Go project issues security fixes to the two most recent major Go releases and provides a security policy for reporting vulnerabilities.
SupportThe official contact page directs users to email [email protected].Questions about using Go or announcements relevant to Go users should be sent to the golang-nuts mailing list.

Plans

dprint

  • Open source dprintFree

dprint pricing →

gofmt

  • gofmtFree

gofmt pricing →

In their own words

dprint

dprint is a command-line application that automatically formats code through a configurable, pluggable system built with Rust and WebAssembly. Its official and wrapper plugins cover languages and formats including TypeScript, JavaScript, JSON, Markdown, TOML, CSS, Dockerfile, C#, Python, Go, Swift, GraphQL, YAML, PHP, LaTeX, R, and Julia. Project configuration files define plugins, formatting settings, included files, and exclusions. Plugins can be loaded from a URL or file path and pinned or versioned in configuration. The project says dprint formats hundreds of files in milliseconds and enables incremental caching by default. WebAssembly plugins run in a sandbox without network or file-system access, while process plugins are executable files and are not sandboxed. Editor integrations are listed for Visual Studio Code, IntelliJ, and Neovim; the language-server command can also be used by other editors. The CLI is distributed as a static binary with no runtime dependencies, with installation options including shell, PowerShell, Cargo, npm, and Homebrew. It is MIT-licensed and free.

Visit dprint.dev

gofmt

gofmt is the Go source formatter distributed with Go installations, available on Linux, macOS, and Windows. It formats Go programs using tabs for indentation and spaces for alignment. With no path, it reads standard input; given a directory, it processes .go files recursively while skipping files whose names begin with a period. By default, reformatted source is written to standard output. Flags can show differences, list files that need formatting, apply rewrite rules, simplify code, or report all errors. The rewrite option uses patterns and replacements written as valid Go expressions. gofmt can also arrange documentation comments into canonical paragraphs, lists, headings, links, and code blocks. The Go project documents integrations for Vim, Emacs, Eclipse, and Sublime Text, plus Git pre-commit hooks and Mercurial. Since Go 1.18, it reads and formats files concurrently, with memory use limited in proportion to GOMAXPROCS. The executable is equivalent to go fmt. It is free, included in the Go installation, and distributed under a BSD-style license.

Visit go.dev