{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:golang/cmd/fix","name":"cmd/fix","description":"Fix finds Go programs that use old APIs and rewrites them to use\nnewer ones.  After you update to a new Go release, fix helps make\nthe necessary changes to your programs.\n\nUsage:\n\nWithout an explicit path, fix reads standard input and writes the\nresult to standard output.\n\nIf the named path is a file, fix rewrites the named files in place.\nIf the named path is a directory, fix rewrites all .go files in that\ndirectory tree.  When fix rewrites a file, it prints a line to standard\nerror giving the name of the file and the rewrite applied.\n\nIf the -diff flag is set, no files are rewritten. Instead fix prints\nthe differences a rewrite would introduce.\n\nThe -r flag restricts the set of rewrites considered to those in the\nnamed list.  By default fix considers all known rewrites.  Fix's\nrewrites are idempotent, so that it is safe to apply fix to updated\nor partially updated code even without using the -r flag.\n\nFix prints the full list of fixes it can apply in its help output;\nto see them, run go tool fix -help.\n\nFix does not make backup copies of the files that it edits.\nInstead, use a version control system's “diff” functionality to inspect\nthe changes that fix makes before committing them.","license":"https://spdx.org/licenses/BSD-3-Clause","codeRepository":"https://cs.opensource.google/go/go","url":"https://cs.opensource.google/go/go","dateModified":"2025-12-13","datePublished":"2025-12-13","softwareHelp":{"@type":"WebSite","url":"https://pkg.go.dev/cmd/fix#section-documentation"},"applicationCategory":"go","runtimePlatform":"go","sameAs":["https://pkg.go.dev/cmd/fix"]}