gitee.com/wgliang/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/golint/testdata/const-block.go (about)

     1  // Test for docs in const blocks
     2  
     3  // Package foo ...
     4  package foo
     5  
     6  const (
     7  	// Prefix for something.
     8  	// MATCH /InlineWhatever.*form/
     9  	InlineWhatever = "blah"
    10  
    11  	Whatsit = "missing_comment" // MATCH /Whatsit.*should have comment.*block/
    12  
    13  	// We should only warn once per block for missing comments,
    14  	// but always complain about malformed comments.
    15  
    16  	WhosYourDaddy = "another_missing_one"
    17  
    18  	// Something
    19  	// MATCH /WhatDoesHeDo.*form/
    20  	WhatDoesHeDo = "it's not a tumor!"
    21  )
    22  
    23  // These shouldn't need doc comments.
    24  const (
    25  	Alpha = "a"
    26  	Beta  = "b"
    27  	Gamma = "g"
    28  )
    29  
    30  // The comment on the previous const block shouldn't flow through to here.
    31  
    32  const UndocAgain = 6 // MATCH /UndocAgain.*should have comment/
    33  
    34  const (
    35  	SomeUndocumented = 7 // MATCH /SomeUndocumented.*should have comment.*block/
    36  )