go-fmt (1) - Linux Manuals

go-fmt: gofmt (reformat) package sources


go-fmt - gofmt (reformat) package sources


go fmt [-n] [-x] [packages]


Fmt runs the command 'gofmt -l -w' on the packages named by the import paths. It prints the names of the files that are modified.

For more about gofmt, see 'go doc cmd/gofmt'.
For more about specifying packages, see go-packages(7).

The -n flag prints commands that would be executed.
The -x flag prints commands as they are executed.
The -mod flag's value sets which module download mode to use: readonly or vendor. See 'go help modules' for more.

To run gofmt with specific options, run gofmt itself.


This manual page was written by Michael Stapelberg <stapelberg [at] debian.org> and is maintained by the Debian Go Compiler Team <team+go-compiler [at] tracker.debian.org> based on the output of 'go help fmt' for the Debian project (and may be used by others).


go-fix(1), go-vet(1).