1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:08:36 -06:00
go/cmd
Alan Donovan 7d75e8b219 cmd/fiximports: a tool to rewrite import paths to match import comments.
fiximports enumerates the set of packages identified by the
command-line arguments, using "go list" notation.  Within each
package, it replaces all imports of non-canonical packages by their
canonical name, introducing an import renaming if (heuristically)
necessary.

If a package comes from one of the -baddomains, and it has no import
comment, fiximports reports an error.  The error message includes the
list of packages that import the errant package, directly or
indirectly.  This flag is used to indicate "sinking ship" package
hosting domains like code.google.com.

Caveat: this process is not trivially reversible.  Consider a package A
to which we add an import comment "B", and run the tool.  Package C,
which imported A, now imports B.  ('go get -u' would fetch package B).
But changing the import comment in directory A and re-running the tool
will not cause C to be changed because it no longer imports A; it
imports B.

+ Tests.

Change-Id: I3d3d9663d3c084356fffc7e55407709ebc6d9a39
Reviewed-on: https://go-review.googlesource.com/8562
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-05-13 15:07:09 +00:00
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
callgraph go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
cover cmd/cover: document that it is moving to the standard repository 2015-05-01 00:38:25 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
fiximports cmd/fiximports: a tool to rewrite import paths to match import comments. 2015-05-13 15:07:09 +00:00
godex tools: add import comments. 2014-12-09 22:42:16 +00:00
godoc cmd/godoc: skip tests on arm platforms 2015-03-16 02:06:44 +00:00
goimports goimports: create a var to permit custom implementations of flag parsing and 2015-03-27 18:14:11 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gotype tools: add import comments. 2014-12-09 22:42:16 +00:00
html2article all: address vet reports 2014-12-29 06:08:34 +00:00
oracle cmd/oracle: improve error messages 2015-05-13 15:02:11 +00:00
present cmd/present: do not show help text on localhost 2015-02-23 10:31:29 +00:00
ssadump go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
stress x/tools/cmd/stress: add utility for stress testing 2015-04-28 09:34:05 +00:00
stringer cmd/stringer: remove os.Exit call from Usage func 2015-03-09 01:18:24 +00:00
tipgodoc cmd/tipgodoc: Kill godoc process if http.ListenAndServe fails 2015-04-08 14:14:19 +00:00
vet cmd/vet: add arm64 asmdecl support 2015-04-22 01:25:24 +00:00