github.com/mattn/go@v0.0.0-20171011075504-07f7db3ea99f/src/cmd/fix/doc.go (about)

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  /*
     6  Fix finds Go programs that use old APIs and rewrites them to use
     7  newer ones.  After you update to a new Go release, fix helps make
     8  the necessary changes to your programs.
     9  
    10  Usage:
    11  	go tool fix [-r name,...] [path ...]
    12  
    13  Without an explicit path, fix reads standard input and writes the
    14  result to standard output.
    15  
    16  If the named path is a file, fix rewrites the named files in place.
    17  If the named path is a directory, fix rewrites all .go files in that
    18  directory tree.  When fix rewrites a file, it prints a line to standard
    19  error giving the name of the file and the rewrite applied.
    20  
    21  If the -diff flag is set, no files are rewritten. Instead fix prints
    22  the differences a rewrite would introduce.
    23  
    24  The -r flag restricts the set of rewrites considered to those in the
    25  named list.  By default fix considers all known rewrites.  Fix's
    26  rewrites are idempotent, so that it is safe to apply fix to updated
    27  or partially updated code even without using the -r flag.
    28  
    29  Fix prints the full list of fixes it can apply in its help output;
    30  to see them, run go tool fix -help.
    31  
    32  Fix does not make backup copies of the files that it edits.
    33  Instead, use a version control system's ``diff'' functionality to inspect
    34  the changes that fix makes before committing them.
    35  */
    36  package main