honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/stylecheck/st1016/testdata/src/example.com/CheckReceiverNamesIdentical/CheckReceiverNames.go (about)

     1  // Package pkg ...
     2  package pkg
     3  
     4  type T1 int
     5  
     6  func (x T1) Fn1()    {} //@ diag(`methods on the same type should have the same receiver name`)
     7  func (y T1) Fn2()    {}
     8  func (x T1) Fn3()    {}
     9  func (T1) Fn4()      {}
    10  func (_ T1) Fn5()    {}
    11  func (self T1) Fn6() {}
    12  
    13  func (bar T3) Fn2()  {} //@ diag(`1x "bar", 1x "meow"`)
    14  func (meow T3) Fn3() {}
    15  
    16  func (bar T4) Fn2() {}