github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/golang/lint/testdata/receiver-names.go (about)

     1  // Test for bad receiver names.
     2  
     3  // Package foo ...
     4  package foo
     5  
     6  type foo struct{}
     7  
     8  func (this foo) f1() { // MATCH /should be a reflection of its identity/
     9  }
    10  
    11  func (self foo) f2() { // MATCH /should be a reflection of its identity/
    12  }
    13  
    14  func (f foo) f3() {
    15  }
    16  
    17  func (foo) f4() {
    18  }
    19  
    20  type bar struct{}
    21  
    22  func (b bar) f1() {
    23  }
    24  
    25  func (b bar) f2() {
    26  }
    27  
    28  func (a bar) f3() { // MATCH /receiver name a should be consistent with previous receiver name b for bar/
    29  }
    30  
    31  func (a *bar) f4() { // MATCH /receiver name a should be consistent with previous receiver name b for bar/
    32  }
    33  
    34  func (b *bar) f5() {
    35  }
    36  
    37  func (bar) f6() {
    38  }
    39  
    40  func (_ *bar) f7() { // MATCH /receiver name should not be an underscore/
    41  }