1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00
go/cmd/fiximports/testdata/src
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
..
fruit.io cmd/fiximports: a tool to rewrite import paths to match import comments. 2015-05-13 15:07:09 +00:00
new.com/one cmd/fiximports: a tool to rewrite import paths to match import comments. 2015-05-13 15:07:09 +00:00
old.com cmd/fiximports: a tool to rewrite import paths to match import comments. 2015-05-13 15:07:09 +00:00
titanic.biz cmd/fiximports: a tool to rewrite import paths to match import comments. 2015-05-13 15:07:09 +00:00