Skip to content

Commit

Permalink
lint(comment): Remove global var
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 10, 2024
1 parent dc7bdc8 commit ab4c4ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/comment/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func Parse(prefix string, n *yaml.Node) (string, Tag) {
// Match comment tag
comment = strings.TrimPrefix(comment, tagSep)

for _, tag := range tags {
for _, tag := range Tags() {
prefix := string(tag) + " "
if strings.HasPrefix(comment, prefix) {
return comment[len(prefix):], tag
Expand Down
17 changes: 9 additions & 8 deletions internal/comment/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ const (
MapTag Tag = "map"
)

//nolint:gochecknoglobals
var tags = []Tag{
BoolTag,
StrTag,
IntTag,
FloatTag,
SeqTag,
MapTag,
func Tags() []Tag {
return []Tag{
BoolTag,
StrTag,
IntTag,
FloatTag,
SeqTag,
MapTag,
}
}

0 comments on commit ab4c4ca

Please sign in to comment.