1
0
mirror of https://github.com/fzipp/gocyclo.git synced 2025-02-06 11:01:57 +00:00

Allow ignore directive with trailing spaces

This commit is contained in:
Frederik Zipp 2020-10-18 18:27:41 +02:00
parent d554ab6362
commit 28ccd9b63a

View File

@ -32,7 +32,7 @@ func parseDirectives(doc *ast.CommentGroup) directives {
var ds directives
for _, comment := range doc.List {
if strings.HasPrefix(comment.Text, prefix) {
ds = append(ds, strings.TrimPrefix(comment.Text, prefix))
ds = append(ds, strings.TrimSpace(strings.TrimPrefix(comment.Text, prefix)))
}
}
return ds