github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/testdata/golint/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 /comment on exported const InlineWhatever should be of the form "InlineWhatever ..."/ 9 InlineWhatever = "blah" 10 11 Whatsit = "missing_comment" // MATCH /exported const Whatsit should have comment (or a comment on this block) or be unexported/ 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 /comment on exported const WhatDoesHeDo should be of the form "WhatDoesHeDo ..."/ 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 /exported const UndocAgain should have comment or be unexported/ 33 34 const ( 35 SomeUndocumented = 7 // MATCH /exported const SomeUndocumented should have comment (or a comment on this block) or be unexported/ 36 )