HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gofumpt — Strictly format Go files. See also: `gofmt`. More information: <https://github.com/mvdan/gofumpt#gof

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandformatfilescligofumptstrictlyseealso

Problem

How to use the gofumpt command: Strictly format Go files. See also: gofmt. More information: <https://github.com/mvdan/gofumpt#gofumpt>.

Solution

gofumpt — Strictly format Go files. See also: gofmt. More information: <https://github.com/mvdan/gofumpt#gofumpt>.

Format Go files:
gofumpt -w {{path/to/directory}}


[l]ist files whose formatting differs from gofumpt:
gofumpt -l {{path/to/directory}}


Report all [e]rrors:
gofumpt -e {{path/to/directory}}


Display [d]iffs:
gofumpt -d {{path/to/directory}}


Format Go files with stricter rules:
gofumpt -extra {{path/to/directory}}


Display [d]iffs with stricter rules:
gofumpt -extra -d {{path/to/directory}}


Display help:
gofumpt {{[-h|--help]}}

Code Snippets

Format Go files

gofumpt -w {{path/to/directory}}

[l]ist files whose formatting differs from `gofumpt`

gofumpt -l {{path/to/directory}}

Report all [e]rrors

gofumpt -e {{path/to/directory}}

Display [d]iffs

gofumpt -d {{path/to/directory}}

Format Go files with stricter rules

gofumpt -extra {{path/to/directory}}

Context

tldr-pages: common/gofumpt

Revisions (0)

No revisions yet.