gitee.com/wgliang/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/golint/testdata/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 /donut\.DonutMaker.*stutter/
     8  
     9  // DonutRank computes the ranking of a donut.
    10  func DonutRank(d Donut) int { // MATCH /donut\.DonutRank.*stutter/
    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  }