You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some import paths are not updated when trying to update the import path of a package containing subdirectories
$ go get code.google.com/p/gographviz
$ gomvpkg -from code.google.com/p/gographviz -to foo
$ go install foo/...
src/foo/analyse.go:18:2: cannot find package "code.google.com/p/gographviz/ast"in any of:
/home/u/go/src/code.google.com/p/gographviz/ast (from $GOROOT)
/home/u/goget/src/code.google.com/p/gographviz/ast (from $GOPATH)
src/foo/gographviz.go:23:2: cannot find package "code.google.com/p/gographviz/parser"in any of:
/home/u/go/src/code.google.com/p/gographviz/parser (from $GOROOT)
/home/u/goget/src/code.google.com/p/gographviz/parser (from $GOPATH)
src/foo/escape.go:18:2: cannot find package "code.google.com/p/gographviz/scanner"in any of:
/home/u/go/src/code.google.com/p/gographviz/scanner (from $GOROOT)
/home/u/goget/src/code.google.com/p/gographviz/scanner (from $GOPATH)
src/foo/escape.go:19:2: cannot find package "code.google.com/p/gographviz/token"in any of:
/home/u/go/src/code.google.com/p/gographviz/token (from $GOROOT)
/home/u/goget/src/code.google.com/p/gographviz/token (from $GOPATH)
To work around this issue one may move the subdirectory packages individually, which results in a lot of warnings but works well until the last step.
$ gomvpkg -from code.google.com/p/gographviz/ast -to foo/ast
/home/u/goget/src/code.google.com/p/gographviz/parser/main.go:19:2: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/parser/main.go:19:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/parser/tables.go:17:8: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/parser/tables.go:17:8: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/parser/parser_test.go:18:2: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/parser/parser_test.go:18:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/analyse.go:18:2: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/analyse.go:18:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/gographviz.go:22:2: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/gographviz.go:22:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/write.go:18:2: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/write.go:18:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/bug_test.go:4:2: renaming this imported package name "ast" to "ast"
/home/u/goget/src/code.google.com/p/gographviz/bug_test.go:4:2: conflicts with imported package name in same block
$ gomvpkg -from code.google.com/p/gographviz/parser -to foo/parser
/home/u/goget/src/code.google.com/p/gographviz/gographviz.go:22:2: renaming this imported package name "parser" to "parser"
/home/u/goget/src/code.google.com/p/gographviz/gographviz.go:22:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/analysewrite_test.go:18:2: renaming this imported package name "parser" to "parser"
/home/u/goget/src/code.google.com/p/gographviz/analysewrite_test.go:18:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/bug_test.go:4:2: renaming this imported package name "parser" to "parser"
/home/u/goget/src/code.google.com/p/gographviz/bug_test.go:4:2: conflicts with imported package name in same block
$ gomvpkg -from code.google.com/p/gographviz/scanner -to foo/scanner
/home/u/goget/src/foo/parser/main.go:19:2: renaming this imported package name "scanner" to "scanner"
/home/u/goget/src/foo/parser/main.go:19:2: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/escape.go:18:2: renaming this imported package name "scanner" to "scanner"
/home/u/goget/src/code.google.com/p/gographviz/escape.go:18:2: conflicts with imported package name in same block
$ gomvpkg -from code.google.com/p/gographviz/token -to foo/token
/home/u/goget/src/foo/ast/ast.go:19:2: renaming this imported package name "token" to "token"
/home/u/goget/src/foo/ast/ast.go:19:2: conflicts with imported package name in same block
/home/u/goget/src/foo/parser/main.go:19:2: renaming this imported package name "token" to "token"
/home/u/goget/src/foo/parser/main.go:19:2: conflicts with imported package name in same block
/home/u/goget/src/foo/parser/parser.go:22:8: renaming this imported package name "token" to "token"
/home/u/goget/src/foo/parser/parser.go:22:8: conflicts with imported package name in same block
/home/u/goget/src/code.google.com/p/gographviz/escape.go:18:2: renaming this imported package name "token" to "token"
/home/u/goget/src/code.google.com/p/gographviz/escape.go:18:2: conflicts with imported package name in same block
/home/u/goget/src/foo/scanner/scanner.go:20:8: renaming this imported package name "token" to "token"
/home/u/goget/src/foo/scanner/scanner.go:20:8: conflicts with imported package name in same block
$ gomvpkg -from code.google.com/p/gographviz -to foo
gomvpkg: invalid move destination: foo conflicts with file /home/u/goget/src/foo.
The last step fails since the foo directory already exists. At this point all the import paths are already updated so one may manually move the contents of gographviz to foo. After this step the package successfully builds using the updated import path.
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
x/tools/cmd/gomvpkg: Doesn't update import path of subdirectories
cmd/gomvpkg: Doesn't update import path of subdirectories
Feb 9, 2015
Some import paths are not updated when trying to update the import path of a package containing subdirectories
To work around this issue one may move the subdirectory packages individually, which results in a lot of warnings but works well until the last step.
The last step fails since the
foo
directory already exists. At this point all the import paths are already updated so one may manually move the contents ofgographviz
tofoo
. After this step the package successfully builds using the updated import path.The text was updated successfully, but these errors were encountered: