GO-FIX(1)

✨ GO-FIX β€” the manual page, but make it cute ✨

okay bestie, welcome to the go-fix page πŸ’– this lil guy lives in the Go programming tools and commands manual, and honestly? it's giving glow-up energy for your codebase. let's get into it 🫢


🌸 NAME 🌸

go-fix β€” update packages to use new APIs ✨

like literally, it takes your old dusty API calls and goes "not anymore babe" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

go fix [build flags] [-fixtool prog] [fix flags] [packages]

that's the whole vibe. build flags, optionally a -fixtool prog, fix flags, and then whichever packages you're feeling πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

so Fix runs the Go fix tool (cmd/fix) on the named packages, and then it applies the suggested fixes. that's it. that's the whole job. it looks at your packages, finds the stuff that's outdated, and fixes it. main character behavior, no cap πŸ‘‘


πŸ‘‘ OPTIONS πŸ‘‘

it supports these flags, periodt:

  • -diff β€” instead of actually applying each fix, it just prints the patch as a unified diff. like a window-shopping mode for your code πŸ”₯

okay and now the important extra lore:

  • the -fixtool=prog flag lets you select a different analysis tool, one with alternative or additional fixers. wanna know the details? go read the documentation for go vet's -vettool flag, it's the same deal 🧚
  • the default fix tool is go tool fix or cmd/fix. for the deets on its fixers and their flags, run:
go tool fix help
  • and for the specifics of one particular fixer β€” say, hostport β€” you go:
go tool fix help hostport
  • for more about how to specify packages (yes there are rules, yes they're a whole thing), see:
go help packages
  • the build flags that go fix supports are the ones that control package resolution and execution, like -C, -n, -x, -v, -tags, and -toolexec. for more about these flags, see:
go help build
heads up bestie: these build flags are specifically the package-resolution-and-execution ones. don't go assuming every build flag on earth applies here πŸ’›

🌈 SEE ALSO 🌈

go fmt(1), go vet(1). go say hi to the cousins 🫢


πŸ’œ AUTHOR πŸ’œ

this manual page was created using help2man</> and afterwards updating the output. 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). iconic of them honestly πŸ’…


and that's the tea πŸ“ this whole page is Go 1.27, dated August 2026, and it lives under GO-FIX(1) in the Go programming tools and commands manual. mwah πŸ’–βœ¨

πŸ“¦ where this page comes from