GO-FMT(1)

πŸ’… go-fmt β€” bestie edition ✨

okay so. go-fmt is literally the glow-up station for your Go package sources. it's gofmt (reformat) but make it a go command. iykyk πŸŽ€


🌸 SYNOPSIS 🌸

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

that's it. that's the whole vibe. πŸ¦‹


✨ DESCRIPTION ✨

okay so here's the tea, bestie: Fmt runs the command gofmt -l -w on the packages named by the import paths. periodt. and then β€” because it's a considerate icon β€” it prints the names of the files that are modified. so you know what got touched. πŸ‘‘

want more lore on gofmt itself? go read go doc cmd/gofmt. want the full breakdown on how to name your packages? that's go help packages. no cap, both are worth it. πŸ“š

now, the flags. keep up:

  • the -n flag prints commands that would be executed. like a lil preview. manifesting but make it CLI. πŸ™ˆ
  • the -x flag prints commands as they are executed. live commentary, real-time, main character energy. πŸ”₯

and then there's the -mod flag β€” its value sets which module download mode to use: readonly or vendor. that's the whole menu, bestie, pick one. for more deets see go help modules. πŸ’–

⚠️ real talk though β€” if you want to run gofmt with specific options, run gofmt itself. go fmt is not the one for that. it's giving "different tool, different job". don't make it awkward. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

  • go fix(1)
  • go vet(1)

like, go look at them. they're right there. slay. ✨


🫢 AUTHOR 🫢

this manual page was created using help2man and afterwards updating the output. (yes, that's the actual process. iconic? debatable. honest? absolutely. πŸ’…)

it is maintained by the Debian Go Compiler Team <team+go-compiler@tracker.debian.org> for the Debian project (and may be used by others). give them their flowers, they earned them. 🌸


✨ and that's a wrap on this one, bestie ✨

this page is chillin' under Go 1.27, dated August 2026. go forth and format responsibly. πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from