]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add go tools to rearrangement
authorRob Pike <r@golang.org>
Sun, 29 Jan 2012 19:07:25 +0000 (11:07 -0800)
committerRob Pike <r@golang.org>
Sun, 29 Jan 2012 19:07:25 +0000 (11:07 -0800)
fix, vet
yacc is also fixed (it was wrong before)
All that's left is the commands used during compilation
This looks like a huge CL, but it's almost all file renames.
The action is in cmd/go/pkg.go, the Makefiles, and .../doc.go.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5595044

117 files changed:
src/cmd/Makefile
src/cmd/fix/Makefile [moved from src/cmd/gofix/Makefile with 96% similarity]
src/cmd/fix/doc.go [new file with mode: 0644]
src/cmd/fix/error.go [moved from src/cmd/gofix/error.go with 100% similarity]
src/cmd/fix/error_test.go [moved from src/cmd/gofix/error_test.go with 100% similarity]
src/cmd/fix/filepath.go [moved from src/cmd/gofix/filepath.go with 100% similarity]
src/cmd/fix/filepath_test.go [moved from src/cmd/gofix/filepath_test.go with 100% similarity]
src/cmd/fix/fix.go [moved from src/cmd/gofix/fix.go with 100% similarity]
src/cmd/fix/go1pkgrename.go [moved from src/cmd/gofix/go1pkgrename.go with 100% similarity]
src/cmd/fix/go1pkgrename_test.go [moved from src/cmd/gofix/go1pkgrename_test.go with 100% similarity]
src/cmd/fix/googlecode.go [moved from src/cmd/gofix/googlecode.go with 100% similarity]
src/cmd/fix/googlecode_test.go [moved from src/cmd/gofix/googlecode_test.go with 100% similarity]
src/cmd/fix/hashsum.go [moved from src/cmd/gofix/hashsum.go with 100% similarity]
src/cmd/fix/hashsum_test.go [moved from src/cmd/gofix/hashsum_test.go with 100% similarity]
src/cmd/fix/hmacnew.go [moved from src/cmd/gofix/hmacnew.go with 100% similarity]
src/cmd/fix/hmacnew_test.go [moved from src/cmd/gofix/hmacnew_test.go with 100% similarity]
src/cmd/fix/htmlerr.go [moved from src/cmd/gofix/htmlerr.go with 100% similarity]
src/cmd/fix/htmlerr_test.go [moved from src/cmd/gofix/htmlerr_test.go with 100% similarity]
src/cmd/fix/httpfinalurl.go [moved from src/cmd/gofix/httpfinalurl.go with 100% similarity]
src/cmd/fix/httpfinalurl_test.go [moved from src/cmd/gofix/httpfinalurl_test.go with 100% similarity]
src/cmd/fix/httpfs.go [moved from src/cmd/gofix/httpfs.go with 100% similarity]
src/cmd/fix/httpfs_test.go [moved from src/cmd/gofix/httpfs_test.go with 100% similarity]
src/cmd/fix/httpheaders.go [moved from src/cmd/gofix/httpheaders.go with 100% similarity]
src/cmd/fix/httpheaders_test.go [moved from src/cmd/gofix/httpheaders_test.go with 100% similarity]
src/cmd/fix/httpserver.go [moved from src/cmd/gofix/httpserver.go with 100% similarity]
src/cmd/fix/httpserver_test.go [moved from src/cmd/gofix/httpserver_test.go with 100% similarity]
src/cmd/fix/httputil.go [moved from src/cmd/gofix/httputil.go with 100% similarity]
src/cmd/fix/httputil_test.go [moved from src/cmd/gofix/httputil_test.go with 100% similarity]
src/cmd/fix/imagecolor.go [moved from src/cmd/gofix/imagecolor.go with 100% similarity]
src/cmd/fix/imagecolor_test.go [moved from src/cmd/gofix/imagecolor_test.go with 100% similarity]
src/cmd/fix/imagenew.go [moved from src/cmd/gofix/imagenew.go with 100% similarity]
src/cmd/fix/imagenew_test.go [moved from src/cmd/gofix/imagenew_test.go with 100% similarity]
src/cmd/fix/imagetiled.go [moved from src/cmd/gofix/imagetiled.go with 100% similarity]
src/cmd/fix/imagetiled_test.go [moved from src/cmd/gofix/imagetiled_test.go with 100% similarity]
src/cmd/fix/imageycbcr.go [moved from src/cmd/gofix/imageycbcr.go with 100% similarity]
src/cmd/fix/imageycbcr_test.go [moved from src/cmd/gofix/imageycbcr_test.go with 100% similarity]
src/cmd/fix/import_test.go [moved from src/cmd/gofix/import_test.go with 100% similarity]
src/cmd/fix/iocopyn.go [moved from src/cmd/gofix/iocopyn.go with 100% similarity]
src/cmd/fix/iocopyn_test.go [moved from src/cmd/gofix/iocopyn_test.go with 100% similarity]
src/cmd/fix/main.go [moved from src/cmd/gofix/main.go with 95% similarity]
src/cmd/fix/main_test.go [moved from src/cmd/gofix/main_test.go with 100% similarity]
src/cmd/fix/mapdelete.go [moved from src/cmd/gofix/mapdelete.go with 100% similarity]
src/cmd/fix/mapdelete_test.go [moved from src/cmd/gofix/mapdelete_test.go with 100% similarity]
src/cmd/fix/math.go [moved from src/cmd/gofix/math.go with 100% similarity]
src/cmd/fix/math_test.go [moved from src/cmd/gofix/math_test.go with 100% similarity]
src/cmd/fix/netdial.go [moved from src/cmd/gofix/netdial.go with 100% similarity]
src/cmd/fix/netdial_test.go [moved from src/cmd/gofix/netdial_test.go with 100% similarity]
src/cmd/fix/netudpgroup.go [moved from src/cmd/gofix/netudpgroup.go with 100% similarity]
src/cmd/fix/netudpgroup_test.go [moved from src/cmd/gofix/netudpgroup_test.go with 100% similarity]
src/cmd/fix/oserrorstring.go [moved from src/cmd/gofix/oserrorstring.go with 100% similarity]
src/cmd/fix/oserrorstring_test.go [moved from src/cmd/gofix/oserrorstring_test.go with 100% similarity]
src/cmd/fix/osopen.go [moved from src/cmd/gofix/osopen.go with 100% similarity]
src/cmd/fix/osopen_test.go [moved from src/cmd/gofix/osopen_test.go with 100% similarity]
src/cmd/fix/procattr.go [moved from src/cmd/gofix/procattr.go with 100% similarity]
src/cmd/fix/procattr_test.go [moved from src/cmd/gofix/procattr_test.go with 100% similarity]
src/cmd/fix/reflect.go [moved from src/cmd/gofix/reflect.go with 99% similarity]
src/cmd/fix/reflect_test.go [moved from src/cmd/gofix/reflect_test.go with 100% similarity]
src/cmd/fix/signal.go [moved from src/cmd/gofix/signal.go with 100% similarity]
src/cmd/fix/signal_test.go [moved from src/cmd/gofix/signal_test.go with 100% similarity]
src/cmd/fix/sorthelpers.go [moved from src/cmd/gofix/sorthelpers.go with 100% similarity]
src/cmd/fix/sorthelpers_test.go [moved from src/cmd/gofix/sorthelpers_test.go with 100% similarity]
src/cmd/fix/sortslice.go [moved from src/cmd/gofix/sortslice.go with 100% similarity]
src/cmd/fix/sortslice_test.go [moved from src/cmd/gofix/sortslice_test.go with 100% similarity]
src/cmd/fix/strconv.go [moved from src/cmd/gofix/strconv.go with 100% similarity]
src/cmd/fix/strconv_test.go [moved from src/cmd/gofix/strconv_test.go with 100% similarity]
src/cmd/fix/stringssplit.go [moved from src/cmd/gofix/stringssplit.go with 100% similarity]
src/cmd/fix/stringssplit_test.go [moved from src/cmd/gofix/stringssplit_test.go with 100% similarity]
src/cmd/fix/template.go [moved from src/cmd/gofix/template.go with 100% similarity]
src/cmd/fix/template_test.go [moved from src/cmd/gofix/template_test.go with 100% similarity]
src/cmd/fix/testdata/reflect.asn1.go.in [moved from src/cmd/gofix/testdata/reflect.asn1.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.asn1.go.out [moved from src/cmd/gofix/testdata/reflect.asn1.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.datafmt.go.in [moved from src/cmd/gofix/testdata/reflect.datafmt.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.datafmt.go.out [moved from src/cmd/gofix/testdata/reflect.datafmt.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.decode.go.in [moved from src/cmd/gofix/testdata/reflect.decode.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.decode.go.out [moved from src/cmd/gofix/testdata/reflect.decode.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.decoder.go.in [moved from src/cmd/gofix/testdata/reflect.decoder.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.decoder.go.out [moved from src/cmd/gofix/testdata/reflect.decoder.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.dnsmsg.go.in [moved from src/cmd/gofix/testdata/reflect.dnsmsg.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.dnsmsg.go.out [moved from src/cmd/gofix/testdata/reflect.dnsmsg.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.encode.go.in [moved from src/cmd/gofix/testdata/reflect.encode.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.encode.go.out [moved from src/cmd/gofix/testdata/reflect.encode.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.encoder.go.in [moved from src/cmd/gofix/testdata/reflect.encoder.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.encoder.go.out [moved from src/cmd/gofix/testdata/reflect.encoder.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.export.go.in [moved from src/cmd/gofix/testdata/reflect.export.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.export.go.out [moved from src/cmd/gofix/testdata/reflect.export.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.print.go.in [moved from src/cmd/gofix/testdata/reflect.print.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.print.go.out [moved from src/cmd/gofix/testdata/reflect.print.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.quick.go.in [moved from src/cmd/gofix/testdata/reflect.quick.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.quick.go.out [moved from src/cmd/gofix/testdata/reflect.quick.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.read.go.in [moved from src/cmd/gofix/testdata/reflect.read.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.read.go.out [moved from src/cmd/gofix/testdata/reflect.read.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.scan.go.in [moved from src/cmd/gofix/testdata/reflect.scan.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.scan.go.out [moved from src/cmd/gofix/testdata/reflect.scan.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.script.go.in [moved from src/cmd/gofix/testdata/reflect.script.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.script.go.out [moved from src/cmd/gofix/testdata/reflect.script.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.template.go.in [moved from src/cmd/gofix/testdata/reflect.template.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.template.go.out [moved from src/cmd/gofix/testdata/reflect.template.go.out with 100% similarity]
src/cmd/fix/testdata/reflect.type.go.in [moved from src/cmd/gofix/testdata/reflect.type.go.in with 100% similarity]
src/cmd/fix/testdata/reflect.type.go.out [moved from src/cmd/gofix/testdata/reflect.type.go.out with 100% similarity]
src/cmd/fix/timefileinfo.go [moved from src/cmd/gofix/timefileinfo.go with 100% similarity]
src/cmd/fix/timefileinfo_test.go [moved from src/cmd/gofix/timefileinfo_test.go with 100% similarity]
src/cmd/fix/typecheck.go [moved from src/cmd/gofix/typecheck.go with 100% similarity]
src/cmd/fix/url.go [moved from src/cmd/gofix/url.go with 100% similarity]
src/cmd/fix/url_test.go [moved from src/cmd/gofix/url_test.go with 100% similarity]
src/cmd/fix/xmlapi.go [moved from src/cmd/gofix/xmlapi.go with 100% similarity]
src/cmd/fix/xmlapi_test.go [moved from src/cmd/gofix/xmlapi_test.go with 100% similarity]
src/cmd/go/fix.go
src/cmd/go/pkg.go
src/cmd/go/vet.go
src/cmd/gofix/doc.go [deleted file]
src/cmd/vet/Makefile [moved from src/cmd/govet/Makefile with 87% similarity]
src/cmd/vet/doc.go [moved from src/cmd/govet/doc.go with 86% similarity]
src/cmd/vet/main.go [moved from src/cmd/govet/govet.go with 97% similarity]
src/cmd/vet/method.go [moved from src/cmd/govet/method.go with 98% similarity]
src/cmd/vet/print.go [moved from src/cmd/govet/print.go with 99% similarity]
src/cmd/vet/structtag.go [moved from src/cmd/govet/structtag.go with 100% similarity]
src/pkg/Makefile

index 089739d05afaaf3333750765c24c4b3786ea824c..ab51c09cebb241fc1b2facf2c897e5b1d92a6164 100644 (file)
@@ -38,10 +38,11 @@ CLEANDIRS=\
        8l\
        cgo\
        godoc\
-       gofix\
+       fix\
        gofmt\
        goinstall\
        gotest\
+       vet\
        yacc\
 
 install: $(patsubst %,%.install,$(DIRS))
similarity index 96%
rename from src/cmd/gofix/Makefile
rename to src/cmd/fix/Makefile
index 553f4f78e325994de2e446b96a742c410365ece8..a03c7e4bc15a42ae7c0545856eb7c792b58ac2bf 100644 (file)
@@ -44,7 +44,7 @@ GOFILES=\
        url.go\
        xmlapi.go\
 
-include ../../Make.cmd
+include ../../Make.tool
 
 test:
        gotest
diff --git a/src/cmd/fix/doc.go b/src/cmd/fix/doc.go
new file mode 100644 (file)
index 0000000..a92e0fc
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+Fix finds Go programs that use old APIs and rewrites them to use
+newer ones.  After you update to a new Go release, fix helps make
+the necessary changes to your programs.
+
+Usage:
+       go tool fix [-r name,...] [path ...]
+
+Without an explicit path, fix reads standard input and writes the
+result to standard output.
+
+If the named path is a file, fix rewrites the named files in place.
+If the named path is a directory, fix rewrites all .go files in that
+directory tree.  When fix rewrites a file, it prints a line to standard
+error giving the name of the file and the rewrite applied.
+
+If the -diff flag is set, no files are rewritten. Instead fix prints
+the differences a rewrite would introduce.
+
+The -r flag restricts the set of rewrites considered to those in the
+named list.  By default fix considers all known rewrites.  Fix's
+rewrites are idempotent, so that it is safe to apply fix to updated
+or partially updated code even without using the -r flag.
+
+Fix prints the full list of fixes it can apply in its help output;
+to see them, run go tool fix -?.
+
+Fix does not make backup copies of the files that it edits.
+Instead, use a version control system's ``diff'' functionality to inspect
+the changes that fix makes before committing them.
+*/
+package documentation
similarity index 100%
rename from src/cmd/gofix/error.go
rename to src/cmd/fix/error.go
similarity index 100%
rename from src/cmd/gofix/fix.go
rename to src/cmd/fix/fix.go
similarity index 95%
rename from src/cmd/gofix/main.go
rename to src/cmd/fix/main.go
index ca7e1a0f320dcf63be423435ef95b78c2ab25af4..23af42ee2023d86550ed7d942db6267d6600c945 100644 (file)
@@ -36,11 +36,11 @@ var allowed, force map[string]bool
 
 var doDiff = flag.Bool("diff", false, "display diffs instead of rewriting files")
 
-// enable for debugging gofix failures
+// enable for debugging fix failures
 const debug = false // display incorrectly reformatted source and exit
 
 func usage() {
-       fmt.Fprintf(os.Stderr, "usage: gofix [-diff] [-r fixname,...] [-force fixname,...] [path ...]\n")
+       fmt.Fprintf(os.Stderr, "usage: go tool fix [-diff] [-r fixname,...] [-force fixname,...] [path ...]\n")
        flag.PrintDefaults()
        fmt.Fprintf(os.Stderr, "\nAvailable rewrites are:\n")
        sort.Sort(byName(fixes))
@@ -244,14 +244,14 @@ func isGoFile(f os.FileInfo) bool {
 }
 
 func diff(b1, b2 []byte) (data []byte, err error) {
-       f1, err := ioutil.TempFile("", "gofix")
+       f1, err := ioutil.TempFile("", "go-fix")
        if err != nil {
                return nil, err
        }
        defer os.Remove(f1.Name())
        defer f1.Close()
 
-       f2, err := ioutil.TempFile("", "gofix")
+       f2, err := ioutil.TempFile("", "go-fix")
        if err != nil {
                return nil, err
        }
similarity index 100%
rename from src/cmd/gofix/math.go
rename to src/cmd/fix/math.go
similarity index 99%
rename from src/cmd/gofix/reflect.go
rename to src/cmd/fix/reflect.go
index 4665d1527ced697bbd4e582f2b4a2af237ff51b8..187d6c0a2d6471fe8061b4433ee0217a4e5393b5 100644 (file)
@@ -87,8 +87,8 @@ http://codereview.appspot.com/4433066
 // x.(*reflect.MapValue).Elem(v) becomes x.MapIndex(v).
 // In general, reflectFn needs to know the type of the receiver expression.
 // In most cases (and in all the cases in the Go source tree), the toy
-// type checker in typecheck.go provides enough information for gofix
-// to make the rewrite.  If gofix misses a rewrite, the code that is left over
+// type checker in typecheck.go provides enough information for fix
+// to make the rewrite.  If fix misses a rewrite, the code that is left over
 // will not compile, so it will be noticed immediately.
 
 func reflectFn(f *ast.File) bool {
similarity index 100%
rename from src/cmd/gofix/url.go
rename to src/cmd/fix/url.go
index bae9f5c9820595c424493dc0d483ee71e3b27c2a..fb4c07e4a2ddc3b9902ea6f02e15e294be739d5e 100644 (file)
@@ -9,12 +9,12 @@ var cmdFix = &Command{
        UsageLine: "fix [importpath...]",
        Short:     "run gofix on packages",
        Long: `
-Fix runs the gofix command on the packages named by the import paths.
+Fix runs the Go fix command on the packages named by the import paths.
 
-For more about gofix, see 'godoc gofix'.
+For more about fix, see 'godoc fix'.
 For more about import paths, see 'go help importpath'.
 
-To run gofix with specific options, run gofix itself.
+To run fix with specific options, run 'go tool fix'.
 
 See also: go fmt, go vet.
        `,
index 21fbb273db83d57e0bd9d25cb41867b32c256d54..2ca0bf7d4795ac8a40f28f52a29905af2239e196 100644 (file)
@@ -224,6 +224,14 @@ Loop:
        return string(b)
 }
 
+// isGoTool is the list of directories for Go programs that are installed in
+// $GOROOT/bin/go-tool.
+var isGoTool = map[string]bool{
+       "cmd/fix":  true,
+       "cmd/vet":  true,
+       "cmd/yacc": true,
+}
+
 func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string, stk *importStack) *Package {
        // Read the files in the directory to learn the structure
        // of the package.
@@ -262,7 +270,11 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
 
        if info.Package == "main" {
                _, elem := filepath.Split(importPath)
-               p.target = filepath.Join(t.BinDir(), elem)
+               if t.Goroot && isGoTool[p.ImportPath] {
+                       p.target = filepath.Join(t.Path, "bin/go-tool", elem)
+               } else {
+                       p.target = filepath.Join(t.BinDir(), elem)
+               }
                if ctxt.GOOS == "windows" {
                        p.target += ".exe"
                }
index 52c3200325f0bb4b192e820d1a6f23c90398fdf1..83e5233ecc0a6f89b65b96e6645ff68caa7d9ab3 100644 (file)
@@ -9,12 +9,12 @@ var cmdVet = &Command{
        UsageLine: "vet [importpath...]",
        Short:     "run govet on packages",
        Long: `
-Vet runs the govet command on the packages named by the import paths.
+Vet runs the Go vet command on the packages named by the import paths.
 
-For more about govet, see 'godoc govet'.
+For more about vet, see 'godoc vet'.
 For more about import paths, see 'go help importpath'.
 
-To run govet with specific options, run govet itself.
+To run govet with specific options, run 'go tool vet'.
 
 See also: go fmt, go fix.
        `,
diff --git a/src/cmd/gofix/doc.go b/src/cmd/gofix/doc.go
deleted file mode 100644 (file)
index a9790e6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Gofix finds Go programs that use old APIs and rewrites them to use
-newer ones.  After you update to a new Go release, gofix helps make
-the necessary changes to your programs.
-
-Usage:
-       gofix [-r name,...] [path ...]
-
-Without an explicit path, gofix reads standard input and writes the
-result to standard output.
-
-If the named path is a file, gofix rewrites the named files in place.
-If the named path is a directory, gofix rewrites all .go files in that
-directory tree.  When gofix rewrites a file, it prints a line to standard
-error giving the name of the file and the rewrite applied.
-
-If the -diff flag is set, no files are rewritten. Instead gofix prints
-the differences a rewrite would introduce.
-
-The -r flag restricts the set of rewrites considered to those in the
-named list.  By default gofix considers all known rewrites.  Gofix's
-rewrites are idempotent, so that it is safe to apply gofix to updated
-or partially updated code even without using the -r flag.
-
-Gofix prints the full list of fixes it can apply in its help output;
-to see them, run gofix -?.
-
-Gofix does not make backup copies of the files that it edits.
-Instead, use a version control system's ``diff'' functionality to inspect
-the changes that gofix makes before committing them.
-*/
-package documentation
similarity index 87%
rename from src/cmd/govet/Makefile
rename to src/cmd/vet/Makefile
index dae3ae51d53c8234bfc48d695608b0a27f3fbc51..a69f0e3beac864ef572a05bcf179e7397a970631 100644 (file)
@@ -4,14 +4,14 @@
 
 include ../../Make.inc
 
-TARG=govet
+TARG=vet
 GOFILES=\
-       govet.go\
+       main.go\
        method.go\
        print.go\
        structtag.go\
 
-include ../../Make.cmd
+include ../../Make.tool
 
 test testshort: $(TARG)
        ../../../test/errchk $(TARG) -printfuncs='Warn:1,Warnf:1' print.go
similarity index 86%
rename from src/cmd/govet/doc.go
rename to src/cmd/vet/doc.go
index 5a2489fca7c5cff43681641fa265e10f396854ff..2495e8027badb3b30a144f4f74f310bcf15cb1bf 100644 (file)
@@ -4,7 +4,7 @@
 
 /*
 
-Govet does simple checking of Go source code.
+Vet does simple checking of Go source code.
 
 It checks for simple errors in calls to functions named
        Print Printf Println
@@ -13,13 +13,13 @@ It checks for simple errors in calls to functions named
        Error Errorf
        Fatal Fatalf
 If the function name ends with an 'f', the function is assumed to take
-a format descriptor string in the manner of fmt.Printf. If not, govet
+a format descriptor string in the manner of fmt.Printf. If not, vet
 complains about arguments that look like format descriptor strings.
 
 Usage:
 
-       govet [flag] [file.go ...]
-       govet [flag] [directory ...] # Scan all .go files under directory, recursively
+       go tool vet [flag] [file.go ...]
+       go tool vet [flag] [directory ...] # Scan all .go files under directory, recursively
 
 The flags are:
        -v
similarity index 97%
rename from src/cmd/govet/govet.go
rename to src/cmd/vet/main.go
index 283f1613f31f3c23847879261016ae98a0de0ec3..5f9d5946688f619c0ed24360fd55fd442c88e9ad 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Govet is a simple checker for static errors in Go source code.
+// Vet is a simple checker for static errors in Go source code.
 // See doc.go for more information.
 package main
 
@@ -120,7 +120,7 @@ func walkDir(root string) {
 // error formats the error to standard error, adding program
 // identification and a newline
 func errorf(format string, args ...interface{}) {
-       fmt.Fprintf(os.Stderr, "govet: "+format+"\n", args...)
+       fmt.Fprintf(os.Stderr, "vet: "+format+"\n", args...)
        setExit(2)
 }
 
similarity index 98%
rename from src/cmd/govet/method.go
rename to src/cmd/vet/method.go
index 55bf11d167ffcaea0b7c552470ece402603809c3..6bf5e2a18f54427a47678e7afd7f8e4ebd6e7b42 100644 (file)
@@ -23,7 +23,7 @@ type MethodSig struct {
 // checks are dynamic, such methods would not cause a compile error
 // if they have the wrong signature: instead the dynamic check would
 // fail, sometimes mysteriously.  If a method is found with a name listed
-// here but not the input/output types listed here, govet complains.
+// here but not the input/output types listed here, vet complains.
 //
 // A few of the canonical methods have very common names.
 // For example, a type might implement a Scan method that
similarity index 99%
rename from src/cmd/govet/print.go
rename to src/cmd/vet/print.go
index 861a337c6f9e373a59f0d058d7a8e2e310c5020b..fe94137a7ee0a1116cd267bec54cfeef7c765403 100644 (file)
@@ -156,7 +156,7 @@ const (
 )
 
 // printVerbs identifies which flags are known to printf for each verb.
-// TODO: A type that implements Formatter may do what it wants, and govet
+// TODO: A type that implements Formatter may do what it wants, and vet
 // will complain incorrectly.
 var printVerbs = []printVerb{
        // '-' is a width modifier, always valid.
index 6ffa527da259b173fd6c203342b0ac1d743982e6..c272fa947c80c1295cc52b5586e33f6fc028c0db 100644 (file)
@@ -156,11 +156,11 @@ DIRS=\
        unicode/utf8\
        ../cmd/cgo\
        ../cmd/godoc\
-       ../cmd/gofix\
+       ../cmd/fix\
        ../cmd/gofmt\
        ../cmd/goinstall\
        ../cmd/gotest\
-       ../cmd/govet\
+       ../cmd/vet\
        ../cmd/yacc\
 
 ifeq ($(GOOS),linux)