]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: split out cmd/go/internal/clean,doc,fix,generate,list,run,tool,version,vet
authorRuss Cox <rsc@golang.org>
Wed, 18 Jan 2017 18:49:50 +0000 (13:49 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 3 Feb 2017 20:32:28 +0000 (20:32 +0000)
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: Ib22fc435827d4a05a77a5200ac437ce00e2a4da3
Reviewed-on: https://go-review.googlesource.com/36204
Reviewed-by: David Crawshaw <crawshaw@golang.org>
16 files changed:
src/cmd/dist/deps.go
src/cmd/go/internal/clean/clean.go [moved from src/cmd/go/clean.go with 96% similarity]
src/cmd/go/internal/doc/doc.go [moved from src/cmd/go/doc.go with 98% similarity]
src/cmd/go/internal/fix/fix.go [moved from src/cmd/go/fix.go with 95% similarity]
src/cmd/go/internal/generate/generate.go [moved from src/cmd/go/generate.go with 98% similarity]
src/cmd/go/internal/generate/generate_test.go [moved from src/cmd/go/generate_test.go with 98% similarity]
src/cmd/go/internal/get/pkg_test.go [moved from src/cmd/go/pkg_test.go with 99% similarity]
src/cmd/go/internal/get/tag_test.go [moved from src/cmd/go/tag_test.go with 99% similarity]
src/cmd/go/internal/get/vcs_test.go [moved from src/cmd/go/vcs_test.go with 99% similarity]
src/cmd/go/internal/list/context.go [moved from src/cmd/go/context.go with 99% similarity]
src/cmd/go/internal/list/list.go [moved from src/cmd/go/list.go with 96% similarity]
src/cmd/go/internal/run/run.go [moved from src/cmd/go/run.go with 95% similarity]
src/cmd/go/internal/tool/tool.go [moved from src/cmd/go/tool.go with 97% similarity]
src/cmd/go/internal/version/version.go [moved from src/cmd/go/version.go with 92% similarity]
src/cmd/go/internal/vet/vet.go [moved from src/cmd/go/vet.go with 95% similarity]
src/cmd/go/main.go

index 3476ff3828d09ac549c74cc3aa5ba0094d0ba16e..e4a025701bdf4d28857cfa275674ee50c8c6afdc 100644 (file)
@@ -6,12 +6,26 @@ var builddeps = map[string][]string{
        "bufio":                             {"bytes", "errors", "internal/race", "io", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sync", "sync/atomic", "unicode", "unicode/utf8"},
        "bytes":                             {"errors", "internal/race", "io", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sync", "sync/atomic", "unicode", "unicode/utf8"},
        "cmd/go/internal/base":              {"bufio", "bytes", "cmd/go/internal/cfg", "cmd/go/internal/str", "context", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/bug":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/env", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/web", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "cmd/go/internal/buildid":           {"bufio", "bytes", "cmd/go/internal/cfg", "compress/flate", "compress/zlib", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "cmd/go/internal/cfg":               {"bufio", "bytes", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/clean":             {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/doc":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/cfg", "cmd/go/internal/str", "context", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/env":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/fix":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "compress/flate", "compress/zlib", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/fmt":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "compress/flate", "compress/zlib", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/generate":          {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/get":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/web", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding", "encoding/base64", "encoding/binary", "encoding/json", "encoding/xml", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/singleflight", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "cmd/go/internal/help":              {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/cfg", "cmd/go/internal/str", "context", "encoding", "encoding/base64", "encoding/json", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "html", "html/template", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/list":              {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding", "encoding/base64", "encoding/binary", "encoding/json", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "cmd/go/internal/load":              {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/str", "compress/flate", "compress/zlib", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/run":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "cmd/go/internal/str":               {"bytes", "errors", "fmt", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "cmd/go/internal/test":              {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/tool":              {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/cfg", "cmd/go/internal/str", "context", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/version":           {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/cfg", "cmd/go/internal/str", "context", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/vet":               {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go/internal/web":               {"errors", "internal/race", "io", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sync", "sync/atomic"},
        "cmd/go/internal/work":              {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/load", "cmd/go/internal/str", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding/binary", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "compress/flate":                    {"bufio", "bytes", "errors", "fmt", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "compress/zlib":                     {"bufio", "bytes", "compress/flate", "errors", "fmt", "hash", "hash/adler32", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8"},
@@ -26,6 +40,7 @@ var builddeps = map[string][]string{
        "encoding/base64":                   {"errors", "internal/race", "io", "math", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "strconv", "sync", "sync/atomic", "unicode/utf8"},
        "encoding/binary":                   {"errors", "internal/race", "io", "math", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "strconv", "sync", "sync/atomic", "unicode/utf8"},
        "encoding/json":                     {"bytes", "encoding", "encoding/base64", "errors", "fmt", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "encoding/xml":                      {"bufio", "bytes", "encoding", "errors", "fmt", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "strconv", "strings", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8"},
        "errors":                            {"runtime", "runtime/internal/atomic", "runtime/internal/sys"},
        "flag":                              {"errors", "fmt", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode/utf16", "unicode/utf8"},
        "fmt":                               {"errors", "internal/race", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "math", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode/utf16", "unicode/utf8"},
@@ -72,5 +87,5 @@ var builddeps = map[string][]string{
        "unicode":                 {"runtime", "runtime/internal/atomic", "runtime/internal/sys"},
        "unicode/utf16":           {"runtime", "runtime/internal/atomic", "runtime/internal/sys"},
        "unicode/utf8":            {"runtime", "runtime/internal/atomic", "runtime/internal/sys"},
-       "cmd/go":                  {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/help", "cmd/go/internal/load", "cmd/go/internal/str", "cmd/go/internal/test", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding", "encoding/base64", "encoding/binary", "encoding/json", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "html", "html/template", "internal/race", "internal/singleflight", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
+       "cmd/go":                  {"bufio", "bytes", "cmd/go/internal/base", "cmd/go/internal/bug", "cmd/go/internal/buildid", "cmd/go/internal/cfg", "cmd/go/internal/clean", "cmd/go/internal/doc", "cmd/go/internal/env", "cmd/go/internal/fix", "cmd/go/internal/fmt", "cmd/go/internal/generate", "cmd/go/internal/get", "cmd/go/internal/help", "cmd/go/internal/list", "cmd/go/internal/load", "cmd/go/internal/run", "cmd/go/internal/str", "cmd/go/internal/test", "cmd/go/internal/tool", "cmd/go/internal/version", "cmd/go/internal/vet", "cmd/go/internal/web", "cmd/go/internal/work", "compress/flate", "compress/zlib", "container/heap", "context", "crypto", "crypto/sha1", "debug/dwarf", "debug/elf", "debug/macho", "encoding", "encoding/base64", "encoding/binary", "encoding/json", "encoding/xml", "errors", "flag", "fmt", "go/ast", "go/build", "go/doc", "go/parser", "go/scanner", "go/token", "hash", "hash/adler32", "html", "html/template", "internal/race", "internal/singleflight", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "io", "io/ioutil", "log", "math", "net/url", "os", "os/exec", "os/signal", "path", "path/filepath", "reflect", "regexp", "regexp/syntax", "runtime", "runtime/internal/atomic", "runtime/internal/sys", "sort", "strconv", "strings", "sync", "sync/atomic", "syscall", "text/template", "text/template/parse", "time", "unicode", "unicode/utf16", "unicode/utf8"},
 }
similarity index 96%
rename from src/cmd/go/clean.go
rename to src/cmd/go/internal/clean/clean.go
index 10777be57cb5efd900447bed1673c3ab16cc9da2..df57deff1d5bb7b0ceb3e34cf4a40c07050d173c 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.
 
-package main
+package clean
 
 import (
        "fmt"
@@ -17,7 +17,7 @@ import (
        "cmd/go/internal/work"
 )
 
-var cmdClean = &base.Command{
+var CmdClean = &base.Command{
        UsageLine: "clean [-i] [-r] [-n] [-x] [build flags] [packages]",
        Short:     "remove object files",
        Long: `
@@ -68,15 +68,15 @@ var cleanR bool // clean -r flag
 
 func init() {
        // break init cycle
-       cmdClean.Run = runClean
+       CmdClean.Run = runClean
 
-       cmdClean.Flag.BoolVar(&cleanI, "i", false, "")
-       cmdClean.Flag.BoolVar(&cleanR, "r", false, "")
+       CmdClean.Flag.BoolVar(&cleanI, "i", false, "")
+       CmdClean.Flag.BoolVar(&cleanR, "r", false, "")
        // -n and -x are important enough to be
        // mentioned explicitly in the docs but they
        // are part of the build flags.
 
-       work.AddBuildFlags(cmdClean)
+       work.AddBuildFlags(CmdClean)
 }
 
 func runClean(cmd *base.Command, args []string) {
similarity index 98%
rename from src/cmd/go/doc.go
rename to src/cmd/go/internal/doc/doc.go
index 5a71717a399305b6bbc7b33b49d0db991ca049b6..512f312fe74d64a1005d02c49396375929ecf7a3 100644 (file)
@@ -2,16 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:generate ./mkalldocs.sh
-
-package main
+package doc
 
 import (
        "cmd/go/internal/base"
        "cmd/go/internal/cfg"
 )
 
-var cmdDoc = &base.Command{
+var CmdDoc = &base.Command{
        Run:         runDoc,
        UsageLine:   "doc [-u] [-c] [package|[package.]symbol[.method]]",
        CustomFlags: true,
similarity index 95%
rename from src/cmd/go/fix.go
rename to src/cmd/go/internal/fix/fix.go
index b94d067003e8e1f5b70c2092abea2b2f53a9ffa6..0475dc379934bd549bca5df8f31d380bf1ccf53a 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.
 
-package main
+package fix
 
 import (
        "cmd/go/internal/base"
@@ -11,7 +11,7 @@ import (
        "cmd/go/internal/str"
 )
 
-var cmdFix = &base.Command{
+var CmdFix = &base.Command{
        Run:       runFix,
        UsageLine: "fix [packages]",
        Short:     "run go tool fix on packages",
similarity index 98%
rename from src/cmd/go/generate.go
rename to src/cmd/go/internal/generate/generate.go
index bc08e999007c6b432e35b35381e34f525eba2f35..07f3d13938260611446948e0fc9801ea0cbc4a19 100644 (file)
@@ -2,15 +2,11 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package generate
 
 import (
        "bufio"
        "bytes"
-       "cmd/go/internal/base"
-       "cmd/go/internal/cfg"
-       "cmd/go/internal/load"
-       "cmd/go/internal/work"
        "fmt"
        "io"
        "log"
@@ -20,9 +16,14 @@ import (
        "regexp"
        "strconv"
        "strings"
+
+       "cmd/go/internal/base"
+       "cmd/go/internal/cfg"
+       "cmd/go/internal/load"
+       "cmd/go/internal/work"
 )
 
-var cmdGenerate = &base.Command{
+var CmdGenerate = &base.Command{
        Run:       runGenerate,
        UsageLine: "generate [-run regexp] [-n] [-v] [-x] [build flags] [file.go... | packages]",
        Short:     "generate Go files by processing source",
@@ -135,8 +136,8 @@ var (
 )
 
 func init() {
-       work.AddBuildFlags(cmdGenerate)
-       cmdGenerate.Flag.StringVar(&generateRunFlag, "run", "", "")
+       work.AddBuildFlags(CmdGenerate)
+       CmdGenerate.Flag.StringVar(&generateRunFlag, "run", "", "")
 }
 
 func runGenerate(cmd *base.Command, args []string) {
similarity index 98%
rename from src/cmd/go/generate_test.go
rename to src/cmd/go/internal/generate/generate_test.go
index dd116e6cc614fbb0bfe36a9202656f96b95c4f23..defc15387f39a30b6111e4482cb8ab1f746883bb 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.
 
-package main
+package generate
 
 import (
        "reflect"
similarity index 99%
rename from src/cmd/go/pkg_test.go
rename to src/cmd/go/internal/get/pkg_test.go
index 00a7b9d06ac90be4381d3af0f0b3ccc4d4c96031..506bb8f4c6c737e2f8116c3c1049ef789ecf5545 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.
 
-package main
+package get
 
 import (
        "cmd/go/internal/load"
similarity index 99%
rename from src/cmd/go/tag_test.go
rename to src/cmd/go/internal/get/tag_test.go
index 6649bd6195248c2cb3fb40ec17fc949cb24d27d6..9a25dfafbc3559b5440c31f69a9ab9648c18516d 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.
 
-package main
+package get
 
 import "testing"
 
similarity index 99%
rename from src/cmd/go/vcs_test.go
rename to src/cmd/go/internal/get/vcs_test.go
index e3a6b762e9939d532997da2c408a34ca0eea807f..f858ee9ddc6f1c56f34a986b26b0f65e4b380839 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.
 
-package main
+package get
 
 import (
        "errors"
similarity index 99%
rename from src/cmd/go/context.go
rename to src/cmd/go/internal/list/context.go
index 94cd54d00d8a474057ab1e6d974533b858e1c739..68d691ebe2eeccd0e7f16ca8528204d0296854e9 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.
 
-package main
+package list
 
 import (
        "go/build"
similarity index 96%
rename from src/cmd/go/list.go
rename to src/cmd/go/internal/list/list.go
index 25b0c96e65275ca5886d3dde086cf76ed3798df5..2f7ae6f72b889a7cb28886ca3293af5d3d192783 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.
 
-package main
+package list
 
 import (
        "bufio"
@@ -17,7 +17,7 @@ import (
        "text/template"
 )
 
-var cmdList = &base.Command{
+var CmdList = &base.Command{
        UsageLine: "list [-e] [-f format] [-json] [build flags] [packages]",
        Short:     "list packages",
        Long: `
@@ -140,13 +140,13 @@ For more about specifying packages, see 'go help packages'.
 }
 
 func init() {
-       cmdList.Run = runList // break init cycle
-       work.AddBuildFlags(cmdList)
+       CmdList.Run = runList // break init cycle
+       work.AddBuildFlags(CmdList)
 }
 
-var listE = cmdList.Flag.Bool("e", false, "")
-var listFmt = cmdList.Flag.String("f", "{{.ImportPath}}", "")
-var listJson = cmdList.Flag.Bool("json", false, "")
+var listE = CmdList.Flag.Bool("e", false, "")
+var listFmt = CmdList.Flag.String("f", "{{.ImportPath}}", "")
+var listJson = CmdList.Flag.Bool("json", false, "")
 var nl = []byte{'\n'}
 
 func runList(cmd *base.Command, args []string) {
similarity index 95%
rename from src/cmd/go/run.go
rename to src/cmd/go/internal/run/run.go
index 37209b366054afe3c99ae849c300af40a6fb8ae5..edd3ddd8432a9d7cefd52189c3209959c4bfe7bc 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.
 
-package main
+package run
 
 import (
        "fmt"
@@ -16,7 +16,7 @@ import (
        "cmd/go/internal/work"
 )
 
-var cmdRun = &base.Command{
+var CmdRun = &base.Command{
        UsageLine: "run [build flags] [-exec xprog] gofiles... [arguments...]",
        Short:     "compile and run Go program",
        Long: `
@@ -40,10 +40,10 @@ See also: go build.
 }
 
 func init() {
-       cmdRun.Run = runRun // break init loop
+       CmdRun.Run = runRun // break init loop
 
-       work.AddBuildFlags(cmdRun)
-       cmdRun.Flag.Var((*base.StringsFlag)(&work.ExecCmd), "exec", "")
+       work.AddBuildFlags(CmdRun)
+       CmdRun.Flag.Var((*base.StringsFlag)(&work.ExecCmd), "exec", "")
 }
 
 func printStderr(args ...interface{}) (int, error) {
similarity index 97%
rename from src/cmd/go/tool.go
rename to src/cmd/go/internal/tool/tool.go
index 2f08c419f3f51520a19215e30beda1112b53666c..1a3e0765212b2acb8e1b23332ca41204e5c35a6b 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.
 
-package main
+package tool
 
 import (
        "fmt"
@@ -15,7 +15,7 @@ import (
        "cmd/go/internal/cfg"
 )
 
-var cmdTool = &base.Command{
+var CmdTool = &base.Command{
        Run:       runTool,
        UsageLine: "tool [-n] command [args...]",
        Short:     "run specified go tool",
@@ -33,7 +33,7 @@ For more about each tool command, see 'go tool command -h'.
 var toolN bool
 
 func init() {
-       cmdTool.Flag.BoolVar(&toolN, "n", false, "")
+       CmdTool.Flag.BoolVar(&toolN, "n", false, "")
 }
 
 func runTool(cmd *base.Command, args []string) {
similarity index 92%
rename from src/cmd/go/version.go
rename to src/cmd/go/internal/version/version.go
index 7cc949569a3387636a21ee96543be3aa60446890..550f31a3438c975515e8649f00a49aa280be7fc4 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.
 
-package main
+package version
 
 import (
        "cmd/go/internal/base"
@@ -10,7 +10,7 @@ import (
        "runtime"
 )
 
-var cmdVersion = &base.Command{
+var CmdVersion = &base.Command{
        Run:       runVersion,
        UsageLine: "version",
        Short:     "print Go version",
similarity index 95%
rename from src/cmd/go/vet.go
rename to src/cmd/go/internal/vet/vet.go
index 01e391c86249f39c40c54f6b5552eef977a117d3..fa60d998e138629593116a3472e481be9067f524 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.
 
-package main
+package vet
 
 import (
        "path/filepath"
@@ -15,10 +15,10 @@ import (
 )
 
 func init() {
-       work.AddBuildFlags(cmdVet)
+       work.AddBuildFlags(CmdVet)
 }
 
-var cmdVet = &base.Command{
+var CmdVet = &base.Command{
        Run:       runVet,
        UsageLine: "vet [-n] [-x] [build flags] [packages]",
        Short:     "run go tool vet on packages",
index 30c7a64c536edc658f5370bfe4c5be1facc12403..1a9f36b0556132aa2a90a07e70c92d1d0fad6386 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:generate ./mkalldocs.sh
+
 package main
 
 import (
@@ -16,32 +18,41 @@ import (
        "cmd/go/internal/base"
        "cmd/go/internal/bug"
        "cmd/go/internal/cfg"
+       "cmd/go/internal/clean"
+       "cmd/go/internal/doc"
        "cmd/go/internal/env"
+       "cmd/go/internal/fix"
        fmtcmd "cmd/go/internal/fmt"
+       "cmd/go/internal/generate"
        "cmd/go/internal/get"
        "cmd/go/internal/help"
+       "cmd/go/internal/list"
+       "cmd/go/internal/run"
        "cmd/go/internal/test"
+       "cmd/go/internal/tool"
+       "cmd/go/internal/version"
+       "cmd/go/internal/vet"
        "cmd/go/internal/work"
 )
 
 func init() {
        base.Commands = []*base.Command{
                work.CmdBuild,
-               cmdClean,
-               cmdDoc,
+               clean.CmdClean,
+               doc.CmdDoc,
                env.CmdEnv,
                bug.CmdBug,
-               cmdFix,
+               fix.CmdFix,
                fmtcmd.CmdFmt,
-               cmdGenerate,
+               generate.CmdGenerate,
                get.CmdGet,
                work.CmdInstall,
-               cmdList,
-               cmdRun,
+               list.CmdList,
+               run.CmdRun,
                test.CmdTest,
-               cmdTool,
-               cmdVersion,
-               cmdVet,
+               tool.CmdTool,
+               version.CmdVersion,
+               vet.CmdVet,
 
                help.HelpC,
                help.HelpBuildmode,
@@ -130,8 +141,6 @@ func main() {
        base.Exit()
 }
 
-var usage func()
-
 func init() {
        base.Usage = mainUsage
 }