aboutsummaryrefslogtreecommitdiff
path: root/oracle/testdata/src/main/implements-methods-json.go
blob: 507dca513990eec50318ee40202e8905f7b56211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

// Tests of 'implements' query applied to methods, -output=json.
// See go.tools/oracle/oracle_test.go for explanation.
// See implements-methods.golden for expected query results.

import _ "lib"
import _ "sort"

func main() {
}

type F interface {
	f() // @implements F.f "f"
}

type FG interface {
	f()       // @implements FG.f "f"
	g() []int // @implements FG.g "g"
}

type C int
type D struct{}

func (c *C) f() {} // @implements *C.f "f"
func (d D) f()  {} // @implements D.f "f"

func (d *D) g() []int { return nil } // @implements *D.g "g"

type sorter []int

func (sorter) Len() int           { return 0 } // @implements Len "Len"
func (sorter) Less(i, j int) bool { return false }
func (sorter) Swap(i, j int)      {}

type I interface {
	Method(*int) *int // @implements I.Method "Method"
}