From 4f8578d2c095328e9192e9d0b0ea335c6ea3e9a5 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 8 Jan 2015 18:32:51 -0800 Subject: [PATCH] astutil: move to go/ast/astutil Change-Id: I9a45bfc07613eb2210081d306d71f0a4d152eda5 Reviewed-on: https://go-review.googlesource.com/2592 Reviewed-by: Alan Donovan --- cmd/vet/bool.go | 2 +- {astutil => go/ast/astutil}/enclosing.go | 0 {astutil => go/ast/astutil}/enclosing_test.go | 2 +- {astutil => go/ast/astutil}/imports.go | 2 +- {astutil => go/ast/astutil}/imports_test.go | 4 ++-- {astutil => go/ast/astutil}/util.go | 0 go/loader/loader.go | 2 +- go/loader/source_test.go | 2 +- go/ssa/source_test.go | 2 +- go/ssa/util.go | 2 +- go/types/builtins.go | 2 +- imports/fix.go | 2 +- imports/imports.go | 2 +- oracle/describe.go | 2 +- oracle/oracle.go | 2 +- oracle/pointsto.go | 2 +- oracle/pos.go | 2 +- oracle/what.go | 2 +- oracle/whicherrs.go | 2 +- refactor/eg/match.go | 2 +- refactor/eg/rewrite.go | 2 +- refactor/rename/util.go | 2 +- refactor/satisfy/find.go | 2 +- 23 files changed, 22 insertions(+), 22 deletions(-) rename {astutil => go/ast/astutil}/enclosing.go (100%) rename {astutil => go/ast/astutil}/enclosing_test.go (99%) rename {astutil => go/ast/astutil}/imports.go (99%) rename {astutil => go/ast/astutil}/imports_test.go (99%) rename {astutil => go/ast/astutil}/util.go (100%) diff --git a/cmd/vet/bool.go b/cmd/vet/bool.go index 257c5c6f..37aac68e 100644 --- a/cmd/vet/bool.go +++ b/cmd/vet/bool.go @@ -10,7 +10,7 @@ import ( "go/ast" "go/token" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" ) func init() { diff --git a/astutil/enclosing.go b/go/ast/astutil/enclosing.go similarity index 100% rename from astutil/enclosing.go rename to go/ast/astutil/enclosing.go diff --git a/astutil/enclosing_test.go b/go/ast/astutil/enclosing_test.go similarity index 99% rename from astutil/enclosing_test.go rename to go/ast/astutil/enclosing_test.go index ace6974a..107f87c5 100644 --- a/astutil/enclosing_test.go +++ b/go/ast/astutil/enclosing_test.go @@ -18,7 +18,7 @@ import ( "strings" "testing" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" ) // pathToString returns a string containing the concrete types of the diff --git a/astutil/imports.go b/go/ast/astutil/imports.go similarity index 99% rename from astutil/imports.go rename to go/ast/astutil/imports.go index 7679b1ff..29f52de6 100644 --- a/astutil/imports.go +++ b/go/ast/astutil/imports.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package astutil contains common utilities for working with the Go AST. -package astutil // import "golang.org/x/tools/astutil" +package astutil // import "golang.org/x/tools/go/ast/astutil" import ( "fmt" diff --git a/astutil/imports_test.go b/go/ast/astutil/imports_test.go similarity index 99% rename from astutil/imports_test.go rename to go/ast/astutil/imports_test.go index 74ded43f..6bc940c6 100644 --- a/astutil/imports_test.go +++ b/go/ast/astutil/imports_test.go @@ -364,12 +364,12 @@ import ( type I int `) // The AddImport order here matters. - AddImport(fset, file, "golang.org/x/tools/astutil") + AddImport(fset, file, "golang.org/x/tools/go/ast/astutil") AddImport(fset, file, "os") want := `package main import ( - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "os" ) diff --git a/astutil/util.go b/go/ast/astutil/util.go similarity index 100% rename from astutil/util.go rename to go/ast/astutil/util.go diff --git a/go/loader/loader.go b/go/loader/loader.go index c568ea2f..ad7e14de 100644 --- a/go/loader/loader.go +++ b/go/loader/loader.go @@ -136,7 +136,7 @@ import ( "os" "strings" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/gcimporter" "golang.org/x/tools/go/types" ) diff --git a/go/loader/source_test.go b/go/loader/source_test.go index d0ca4a75..f2e06be5 100644 --- a/go/loader/source_test.go +++ b/go/loader/source_test.go @@ -13,7 +13,7 @@ import ( "strings" "testing" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/ssa" ) diff --git a/go/ssa/source_test.go b/go/ssa/source_test.go index 203da7f3..68b5401c 100644 --- a/go/ssa/source_test.go +++ b/go/ssa/source_test.go @@ -16,7 +16,7 @@ import ( "strings" "testing" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/exact" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/ssa" diff --git a/go/ssa/util.go b/go/ssa/util.go index 58f4e8d8..cd476d86 100644 --- a/go/ssa/util.go +++ b/go/ssa/util.go @@ -13,7 +13,7 @@ import ( "io" "os" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/types" ) diff --git a/go/types/builtins.go b/go/types/builtins.go index 8447f0b6..f3e88551 100644 --- a/go/types/builtins.go +++ b/go/types/builtins.go @@ -10,7 +10,7 @@ import ( "go/ast" "go/token" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/exact" ) diff --git a/imports/fix.go b/imports/fix.go index 6f441aaa..22fde6c1 100644 --- a/imports/fix.go +++ b/imports/fix.go @@ -16,7 +16,7 @@ import ( "strings" "sync" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" ) // importToGroup is a list of functions which map from an import path to diff --git a/imports/imports.go b/imports/imports.go index c521ae8c..e30946bc 100644 --- a/imports/imports.go +++ b/imports/imports.go @@ -20,7 +20,7 @@ import ( "strconv" "strings" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" ) // Options specifies options for processing files. diff --git a/oracle/describe.go b/oracle/describe.go index 01b245c4..1c329d01 100644 --- a/oracle/describe.go +++ b/oracle/describe.go @@ -13,7 +13,7 @@ import ( "os" "strings" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/exact" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/types" diff --git a/oracle/oracle.go b/oracle/oracle.go index e97d76e5..60cc2be5 100644 --- a/oracle/oracle.go +++ b/oracle/oracle.go @@ -56,7 +56,7 @@ import ( "go/token" "io" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/pointer" "golang.org/x/tools/go/ssa" diff --git a/oracle/pointsto.go b/oracle/pointsto.go index 8f633ad7..10ad0695 100644 --- a/oracle/pointsto.go +++ b/oracle/pointsto.go @@ -10,7 +10,7 @@ import ( "go/token" "sort" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/pointer" "golang.org/x/tools/go/ssa" diff --git a/oracle/pos.go b/oracle/pos.go index 6ca019a0..d5d558b3 100644 --- a/oracle/pos.go +++ b/oracle/pos.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" ) // parseOctothorpDecimal returns the numeric value if s matches "#%d", diff --git a/oracle/what.go b/oracle/what.go index 9ffc0673..c1053f48 100644 --- a/oracle/what.go +++ b/oracle/what.go @@ -14,7 +14,7 @@ import ( "sort" "strings" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/oracle/serial" ) diff --git a/oracle/whicherrs.go b/oracle/whicherrs.go index 9ffe2ac3..a73aa8d1 100644 --- a/oracle/whicherrs.go +++ b/oracle/whicherrs.go @@ -10,7 +10,7 @@ import ( "go/token" "sort" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/ssa" "golang.org/x/tools/go/ssa/ssautil" "golang.org/x/tools/go/types" diff --git a/refactor/eg/match.go b/refactor/eg/match.go index 6c1df4b8..298a258f 100644 --- a/refactor/eg/match.go +++ b/refactor/eg/match.go @@ -8,7 +8,7 @@ import ( "os" "reflect" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/exact" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/types" diff --git a/refactor/eg/rewrite.go b/refactor/eg/rewrite.go index 61cfe88b..db9c693b 100644 --- a/refactor/eg/rewrite.go +++ b/refactor/eg/rewrite.go @@ -14,7 +14,7 @@ import ( "strconv" "strings" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/types" ) diff --git a/refactor/rename/util.go b/refactor/rename/util.go index 8f3c62ae..def93995 100644 --- a/refactor/rename/util.go +++ b/refactor/rename/util.go @@ -13,7 +13,7 @@ import ( "strings" "unicode" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/types" ) diff --git a/refactor/satisfy/find.go b/refactor/satisfy/find.go index 2af37f1e..9770a02b 100644 --- a/refactor/satisfy/find.go +++ b/refactor/satisfy/find.go @@ -49,7 +49,7 @@ import ( "go/ast" "go/token" - "golang.org/x/tools/astutil" + "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/types" )