Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding customizing a configuration file to load G101 rules, where keywords with "-" cannot be matched #1133

Closed
kb-at-zero opened this issue May 8, 2024 · 1 comment

Comments

@kb-at-zero
Copy link

Summary

Regarding customizing a configuration file to load G101 rules, where keywords with "-" cannot be matched.

Steps to reproduce the behavior

Step 1 : The configuration file
image

Step 2 : Need to match content
image

Step 3 : gosec loading configuration file for matching scan
image
It does not match any content

When I replace the keywords with "_" form, gosec can be matched normally
image
image
image

Step 4 : Escape using escape characters
image
image
image

Still unable to match the content

So, I don't know where the problem is occurring that is preventing me from matching keywords with '-'. Can you help me identify where the issue lies? Thank you.

gosec version

2.19.0

Go version (output of 'go version')

Operating system / Environment

Expected behavior

Actual behavior

@ccojocar
Copy link
Member

In Go an identifier can only contains alphanumerical characters and underscore not the minus sign. Please have a look at the specifications: identifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants