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

     1  // Test that exported names have correct comments.
     2  
     3  // Package pkg does something.
     4  package pkg
     5  
     6  import "time"
     7  
     8  type T int // MATCH /exported type T should have comment or be unexported/
     9  
    10  func (T) F() {} // MATCH /exported method T.F should have comment or be unexported/
    11  
    12  // this is a nice type.
    13  // MATCH /comment on exported type U should be of the form "U ..." (with optional leading article)/
    14  type U string
    15  
    16  // this is a neat function.
    17  // MATCH /comment on exported method U.G should be of the form "G ..."/
    18  func (U) G() {}
    19  
    20  // A V is a string.
    21  type V string
    22  
    23  // V.H has a pointer receiver
    24  
    25  func (*V) H() {} // MATCH /exported method V.H should have comment or be unexported/
    26  
    27  var W = "foo" // MATCH /exported var W should have comment or be unexported/
    28  
    29  const X = "bar" // MATCH /exported const X should have comment or be unexported/
    30  
    31  var Y, Z int // MATCH /exported var Z should have its own declaration/
    32  
    33  // Location should be okay, since the other var name is an underscore.
    34  var Location, _ = time.LoadLocation("Europe/Istanbul") // not Constantinople
    35  
    36  // this is improperly documented
    37  // MATCH /comment on exported const Thing should be of the form "Thing ..."/
    38  const Thing = "wonderful"