Commands
marmot fmt
Format Go source and fix its imports, as goimports does.
tidy

Format the Go files of the named packages, files or dir/... trees the way goimports does: gofmt layout, missing imports added, unused imports removed. Files are rewritten in place and listed, like go fmt. -l only lists, -d prints a diff, -check exits 1 when a file is not formatted.
marmot fmt [files or packages] [flags]Examples
marmot fmt
marmot fmt ./...
marmot fmt -d main.go
marmot fmt -check ./...marmot fmt formats the files go fmt would: those of the packages' directories, leaving out
testdata and directories that start with _ or .. It is the fmt check of
marmot check, so the two never disagree.
Flags
Flags take one dash or two: -release and --release are the same.
| Flag | Meaning |
|---|---|
-check | change nothing; exit 1 if a file is not formatted |
-color string | color in human output: auto, always or never (NO_COLOR turns auto off) (default "auto") |
-d | print a diff of the changes instead of writing them |
-json | machine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents) |
-l | only list the files that would change |
Full help
Format the Go files of the named packages, files or dir/... trees the way goimports does: gofmt layout, missing imports added, unused imports removed. Files are rewritten in place and listed, like go fmt. -l only lists, -d prints a diff, -check exits 1 when a file is not formatted.
Usage:
marmot fmt [files or packages] [flags]
Examples:
marmot fmt
marmot fmt ./...
marmot fmt -d main.go
marmot fmt -check ./...
Flags:
--check change nothing; exit 1 if a file is not formatted
--color string color in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
--d print a diff of the changes instead of writing them
-h, --help help for fmt
--json machine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
--l only list the files that would change