github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/testdata/golint/sort.go (about)

     1  // Test that we don't ask for comments on sort.Interface methods.
     2  
     3  // Package pkg ...
     4  package pkg
     5  
     6  // T is ...
     7  type T []int
     8  
     9  // Len by itself should get documented.
    10  
    11  func (t T) Len() int { return len(t) } // MATCH /exported method T.Len should have comment or be unexported/
    12  
    13  // U is ...
    14  type U []int
    15  
    16  func (u U) Len() int           { return len(u) }
    17  func (u U) Less(i, j int) bool { return u[i] < u[j] }
    18  func (u U) Swap(i, j int)      { u[i], u[j] = u[j], u[i] }
    19  
    20  func (u U) Other() {} // MATCH /exported method U.Other should have comment or be unexported/