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

     1  // Test of stuttery names.
     2  
     3  // Package donut ...
     4  package donut
     5  
     6  // DonutMaker makes donuts.
     7  type DonutMaker struct{} // MATCH /type name will be used as donut.DonutMaker by other packages, and that stutters; consider calling this Maker/
     8  
     9  // DonutRank computes the ranking of a donut.
    10  func DonutRank(d Donut) int { // MATCH /func name will be used as donut.DonutRank by other packages, and that stutters; consider calling this Rank/
    11  	return 0
    12  }
    13  
    14  // Donut is a delicious treat.
    15  type Donut struct{} // ok because it is the whole name
    16  
    17  // Donuts are great, aren't they?
    18  type Donuts []Donut // ok because it didn't start a new word
    19  
    20  type donutGlaze int // ok because it is unexported
    21  
    22  // DonutMass reports the mass of a donut.
    23  func (d *Donut) DonutMass() (grams int) { // okay because it is a method
    24  	return 38
    25  }