| 1 | package main |
|---|---|
| 2 | |
| 3 | // Tests of 'implements' query. |
| 4 | // See go.tools/guru/guru_test.go for explanation. |
| 5 | // See implements.golden for expected query results. |
| 6 | |
| 7 | import _ "lib" |
| 8 | |
| 9 | func main() { |
| 10 | } |
| 11 | |
| 12 | type E interface{} // @implements E "E" |
| 13 | |
| 14 | type F interface { // @implements F "F" |
| 15 | f() |
| 16 | } |
| 17 | |
| 18 | type FG interface { // @implements FG "FG" |
| 19 | f() |
| 20 | g() []int // @implements slice "..int" |
| 21 | } |
| 22 | |
| 23 | type C int // @implements C "C" |
| 24 | type D struct{} |
| 25 | |
| 26 | func (c *C) f() {} // @implements starC ".C" |
| 27 | func (d D) f() {} // @implements D "D" |
| 28 | |
| 29 | func (d *D) g() []int { return nil } // @implements starD ".D" |
| 30 | |
| 31 | type sorter []int // @implements sorter "sorter" |
| 32 | |
| 33 | func (sorter) Len() int { return 0 } |
| 34 | func (sorter) Less(i, j int) bool { return false } |
| 35 | func (sorter) Swap(i, j int) {} |
| 36 | |
| 37 | type I interface { // @implements I "I" |
| 38 | Method(*int) *int |
| 39 | } |
| 40 | |
| 41 | func _() { |
| 42 | var d D |
| 43 | _ = d // @implements var_d "d" |
| 44 | } |
| 45 |
Members