Skip to content

Commit

Permalink
checkers: fix Go warning (#928)
Browse files Browse the repository at this point in the history
Make it clear that comments like "go:generate" are examples
and are not actual compiler directives.

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
  • Loading branch information
quasilyte committed May 26, 2020
1 parent f4eb84b commit 870cf89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions checkers/commentFormatting_checker.go
Expand Up @@ -21,11 +21,11 @@ func init() {

collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker {
parts := []string{
`^//go:generate .*$`, //go:generate value
`^//\w+:.*$`, //key: value
`^//nolint$`, //nolint
`^//line /.*:\d+`, //line /path/to/file:123
`^//export \w+$`, // export Foo
`^//go:generate .*$`, // e.g.: go:generate value
`^//\w+:.*$`, // e.g.: key: value
`^//nolint$`, // e.g.: nolint
`^//line /.*:\d+`, // e.g.: line /path/to/file:123
`^//export \w+$`, // e.g.: export Foo
}
pat := "(?m)" + strings.Join(parts, "|")
pragmaRE := regexp.MustCompile(pat)
Expand Down

0 comments on commit 870cf89

Please sign in to comment.