1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00
revive/testdata/golint/const-block.go

43 lines
1.1 KiB
Go
Raw Normal View History

2018-01-24 09:01:49 +02:00
// Test for docs in const blocks
// Package foo ...
package foo
const (
2022-06-28 17:14:26 +02:00
InlineComment = "ShouldBeOK" // InlineComment is a valid comment
2018-01-24 09:01:49 +02:00
// Prefix for something.
// MATCH /comment on exported const InlineWhatever should be of the form "InlineWhatever ..."/
InlineWhatever = "blah"
2022-06-28 17:14:26 +02:00
Whatsit = "missing_comment"
// MATCH:13 /exported const Whatsit should have comment (or a comment on this block) or be unexported/
2018-01-24 09:01:49 +02:00
// We should only warn once per block for missing comments,
// but always complain about malformed comments.
WhosYourDaddy = "another_missing_one"
// Something
// MATCH /comment on exported const WhatDoesHeDo should be of the form "WhatDoesHeDo ..."/
WhatDoesHeDo = "it's not a tumor!"
)
// These shouldn't need doc comments.
const (
Alpha = "a"
Beta = "b"
Gamma = "g"
)
// The comment on the previous const block shouldn't flow through to here.
2022-06-28 17:14:26 +02:00
const UndocAgain = 6
// MATCH:35 /exported const UndocAgain should have comment or be unexported/
2018-01-24 09:01:49 +02:00
const (
2022-06-28 17:14:26 +02:00
SomeUndocumented = 7
// MATCH:40 /exported const SomeUndocumented should have comment (or a comment on this block) or be unexported/
2018-01-24 09:01:49 +02:00
)