github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/oracle/testdata/src/main/implements.go (about)

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