diff --git a/oracle/testdata/src/lib/lib.go b/oracle/testdata/src/lib/lib.go index 0603d4b4629..9131c27474c 100644 --- a/oracle/testdata/src/lib/lib.go +++ b/oracle/testdata/src/lib/lib.go @@ -12,3 +12,9 @@ func Func() { const Const = 3 var Var = 0 + +type Sorter interface { + Len() int + Less(i, j int) bool + Swap(i, j int) +} diff --git a/oracle/testdata/src/main/implements-methods-json.go b/oracle/testdata/src/main/implements-methods-json.go index 507dca51399..6c5bbf454d5 100644 --- a/oracle/testdata/src/main/implements-methods-json.go +++ b/oracle/testdata/src/main/implements-methods-json.go @@ -5,7 +5,6 @@ package main // See implements-methods.golden for expected query results. import _ "lib" -import _ "sort" func main() { } diff --git a/oracle/testdata/src/main/implements-methods-json.golden b/oracle/testdata/src/main/implements-methods-json.golden index a925caaf1f3..8a17efaed90 100644 --- a/oracle/testdata/src/main/implements-methods-json.golden +++ b/oracle/testdata/src/main/implements-methods-json.golden @@ -4,42 +4,42 @@ "implements": { "type": { "name": "main.F", - "pos": "testdata/src/main/implements-methods-json.go:13:6", + "pos": "testdata/src/main/implements-methods-json.go:12:6", "kind": "interface" }, "to": [ { "name": "*main.C", - "pos": "testdata/src/main/implements-methods-json.go:22:6", + "pos": "testdata/src/main/implements-methods-json.go:21:6", "kind": "pointer" }, { "name": "main.D", - "pos": "testdata/src/main/implements-methods-json.go:23:6", + "pos": "testdata/src/main/implements-methods-json.go:22:6", "kind": "struct" }, { "name": "main.FG", - "pos": "testdata/src/main/implements-methods-json.go:17:6", + "pos": "testdata/src/main/implements-methods-json.go:16:6", "kind": "interface" } ], "method": { "name": "func (F).f()", - "pos": "testdata/src/main/implements-methods-json.go:14:2" + "pos": "testdata/src/main/implements-methods-json.go:13:2" }, "to_method": [ { "name": "method (*C) f()", - "pos": "testdata/src/main/implements-methods-json.go:25:13" + "pos": "testdata/src/main/implements-methods-json.go:24:13" }, { "name": "method (D) f()", - "pos": "testdata/src/main/implements-methods-json.go:26:12" + "pos": "testdata/src/main/implements-methods-json.go:25:12" }, { "name": "method (FG) f()", - "pos": "testdata/src/main/implements-methods-json.go:18:2" + "pos": "testdata/src/main/implements-methods-json.go:17:2" } ] } @@ -49,37 +49,37 @@ "implements": { "type": { "name": "main.FG", - "pos": "testdata/src/main/implements-methods-json.go:17:6", + "pos": "testdata/src/main/implements-methods-json.go:16:6", "kind": "interface" }, "to": [ { "name": "*main.D", - "pos": "testdata/src/main/implements-methods-json.go:23:6", + "pos": "testdata/src/main/implements-methods-json.go:22:6", "kind": "pointer" } ], "from": [ { "name": "main.F", - "pos": "testdata/src/main/implements-methods-json.go:13:6", + "pos": "testdata/src/main/implements-methods-json.go:12:6", "kind": "interface" } ], "method": { "name": "func (FG).f()", - "pos": "testdata/src/main/implements-methods-json.go:18:2" + "pos": "testdata/src/main/implements-methods-json.go:17:2" }, "to_method": [ { "name": "method (*D) f()", - "pos": "testdata/src/main/implements-methods-json.go:26:12" + "pos": "testdata/src/main/implements-methods-json.go:25:12" } ], "from_method": [ { "name": "method (F) f()", - "pos": "testdata/src/main/implements-methods-json.go:14:2" + "pos": "testdata/src/main/implements-methods-json.go:13:2" } ] } @@ -89,31 +89,31 @@ "implements": { "type": { "name": "main.FG", - "pos": "testdata/src/main/implements-methods-json.go:17:6", + "pos": "testdata/src/main/implements-methods-json.go:16:6", "kind": "interface" }, "to": [ { "name": "*main.D", - "pos": "testdata/src/main/implements-methods-json.go:23:6", + "pos": "testdata/src/main/implements-methods-json.go:22:6", "kind": "pointer" } ], "from": [ { "name": "main.F", - "pos": "testdata/src/main/implements-methods-json.go:13:6", + "pos": "testdata/src/main/implements-methods-json.go:12:6", "kind": "interface" } ], "method": { "name": "func (FG).g() []int", - "pos": "testdata/src/main/implements-methods-json.go:19:2" + "pos": "testdata/src/main/implements-methods-json.go:18:2" }, "to_method": [ { "name": "method (*D) g() []int", - "pos": "testdata/src/main/implements-methods-json.go:28:13" + "pos": "testdata/src/main/implements-methods-json.go:27:13" } ], "from_method": [ @@ -129,24 +129,24 @@ "implements": { "type": { "name": "*main.C", - "pos": "testdata/src/main/implements-methods-json.go:22:6", + "pos": "testdata/src/main/implements-methods-json.go:21:6", "kind": "pointer" }, "from": [ { "name": "main.F", - "pos": "testdata/src/main/implements-methods-json.go:13:6", + "pos": "testdata/src/main/implements-methods-json.go:12:6", "kind": "interface" } ], "method": { "name": "func (*C).f()", - "pos": "testdata/src/main/implements-methods-json.go:25:13" + "pos": "testdata/src/main/implements-methods-json.go:24:13" }, "from_method": [ { "name": "method (F) f()", - "pos": "testdata/src/main/implements-methods-json.go:14:2" + "pos": "testdata/src/main/implements-methods-json.go:13:2" } ] } @@ -156,37 +156,37 @@ "implements": { "type": { "name": "main.D", - "pos": "testdata/src/main/implements-methods-json.go:23:6", + "pos": "testdata/src/main/implements-methods-json.go:22:6", "kind": "struct" }, "from": [ { "name": "main.F", - "pos": "testdata/src/main/implements-methods-json.go:13:6", + "pos": "testdata/src/main/implements-methods-json.go:12:6", "kind": "interface" } ], "fromptr": [ { "name": "main.FG", - "pos": "testdata/src/main/implements-methods-json.go:17:6", + "pos": "testdata/src/main/implements-methods-json.go:16:6", "kind": "interface" } ], "method": { "name": "func (D).f()", - "pos": "testdata/src/main/implements-methods-json.go:26:12" + "pos": "testdata/src/main/implements-methods-json.go:25:12" }, "from_method": [ { "name": "method (F) f()", - "pos": "testdata/src/main/implements-methods-json.go:14:2" + "pos": "testdata/src/main/implements-methods-json.go:13:2" } ], "fromptr_method": [ { "name": "method (FG) f()", - "pos": "testdata/src/main/implements-methods-json.go:18:2" + "pos": "testdata/src/main/implements-methods-json.go:17:2" } ] } @@ -196,24 +196,24 @@ "implements": { "type": { "name": "*main.D", - "pos": "testdata/src/main/implements-methods-json.go:23:6", + "pos": "testdata/src/main/implements-methods-json.go:22:6", "kind": "pointer" }, "from": [ { "name": "main.F", - "pos": "testdata/src/main/implements-methods-json.go:13:6", + "pos": "testdata/src/main/implements-methods-json.go:12:6", "kind": "interface" }, { "name": "main.FG", - "pos": "testdata/src/main/implements-methods-json.go:17:6", + "pos": "testdata/src/main/implements-methods-json.go:16:6", "kind": "interface" } ], "method": { "name": "func (*D).g() []int", - "pos": "testdata/src/main/implements-methods-json.go:28:13" + "pos": "testdata/src/main/implements-methods-json.go:27:13" }, "from_method": [ { @@ -222,7 +222,7 @@ }, { "name": "method (FG) g() []int", - "pos": "testdata/src/main/implements-methods-json.go:19:2" + "pos": "testdata/src/main/implements-methods-json.go:18:2" } ] } @@ -232,24 +232,24 @@ "implements": { "type": { "name": "main.sorter", - "pos": "testdata/src/main/implements-methods-json.go:30:6", + "pos": "testdata/src/main/implements-methods-json.go:29:6", "kind": "slice" }, "from": [ { - "name": "sort.Interface", - "pos": "/usr/local/google/home/adonovan/go/src/sort/sort.go:12:6", + "name": "lib.Sorter", + "pos": "testdata/src/lib/lib.go:16:6", "kind": "interface" } ], "method": { "name": "func (sorter).Len() int", - "pos": "testdata/src/main/implements-methods-json.go:32:15" + "pos": "testdata/src/main/implements-methods-json.go:31:15" }, "from_method": [ { - "name": "method (sort.Interface) Len() int", - "pos": "/usr/local/google/home/adonovan/go/src/sort/sort.go:14:2" + "name": "method (lib.Sorter) Len() int", + "pos": "testdata/src/lib/lib.go:17:2" } ] } @@ -259,7 +259,7 @@ "implements": { "type": { "name": "main.I", - "pos": "testdata/src/main/implements-methods-json.go:36:6", + "pos": "testdata/src/main/implements-methods-json.go:35:6", "kind": "interface" }, "to": [ @@ -271,7 +271,7 @@ ], "method": { "name": "func (I).Method(*int) *int", - "pos": "testdata/src/main/implements-methods-json.go:37:2" + "pos": "testdata/src/main/implements-methods-json.go:36:2" }, "to_method": [ { diff --git a/oracle/testdata/src/main/implements-methods.go b/oracle/testdata/src/main/implements-methods.go index 4cc42889aa7..a24854a64e2 100644 --- a/oracle/testdata/src/main/implements-methods.go +++ b/oracle/testdata/src/main/implements-methods.go @@ -5,7 +5,6 @@ package main // See implements-methods.golden for expected query results. import _ "lib" -import _ "sort" func main() { } diff --git a/oracle/testdata/src/main/implements-methods.golden b/oracle/testdata/src/main/implements-methods.golden index 11ccaf4b11a..bd591e84760 100644 --- a/oracle/testdata/src/main/implements-methods.golden +++ b/oracle/testdata/src/main/implements-methods.golden @@ -29,7 +29,7 @@ concrete method func (*D).g() []int -------- @implements Len -------- concrete method func (sorter).Len() int - implements method (sort.Interface).Len + implements method (lib.Sorter).Len -------- @implements I.Method -------- abstract method func (I).Method(*int) *int diff --git a/oracle/testdata/src/main/implements.go b/oracle/testdata/src/main/implements.go index 0b5ee1202cb..14a2f16f0bc 100644 --- a/oracle/testdata/src/main/implements.go +++ b/oracle/testdata/src/main/implements.go @@ -5,7 +5,6 @@ package main // See implements.golden for expected query results. import _ "lib" -import _ "sort" func main() { } diff --git a/oracle/testdata/src/main/implements.golden b/oracle/testdata/src/main/implements.golden index 01d41f6a4e2..9d5998ac78c 100644 --- a/oracle/testdata/src/main/implements.golden +++ b/oracle/testdata/src/main/implements.golden @@ -36,7 +36,7 @@ pointer type *main.D -------- @implements sorter -------- slice type main.sorter - implements sort.Interface + implements lib.Sorter -------- @implements I -------- interface type main.I diff --git a/oracle/testdata/src/main/imports.golden b/oracle/testdata/src/main/imports.golden index 788a3ad9a17..1994ad62300 100644 --- a/oracle/testdata/src/main/imports.golden +++ b/oracle/testdata/src/main/imports.golden @@ -7,11 +7,15 @@ import of package "hash/fnv" -------- @describe ref-pkg-import -------- import of package "lib" - const Const untyped int = 3 - func Func func() - type Type int + const Const untyped int = 3 + func Func func() + type Sorter interface{...} + method (Sorter) Len() int + method (Sorter) Less(i int, j int) bool + method (Sorter) Swap(i int, j int) + type Type int method (Type) Method(x *int) *int - var Var int + var Var int -------- @describe ref-const -------- reference to const lib.Const untyped int @@ -41,9 +45,13 @@ this *int may point to these objects: -------- @describe ref-pkg -------- reference to package "lib" - const Const untyped int = 3 - func Func func() - type Type int + const Const untyped int = 3 + func Func func() + type Sorter interface{...} + method (Sorter) Len() int + method (Sorter) Less(i int, j int) bool + method (Sorter) Swap(i int, j int) + type Type int method (Type) Method(x *int) *int - var Var int + var Var int