-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix error message on incorrect regexp #14
Conversation
mx-psi
commented
Oct 19, 2021
- Move regex list creation code to separate function (to be used on Add support for skipping based on directories #13 impl)
- Fix error message when compiling a regex
cmd/porto/main.go
Outdated
@@ -12,6 +12,21 @@ import ( | |||
"github.com/jcchavezs/porto" | |||
) | |||
|
|||
func getRegexpList(flagVal string) ([]*regexp.Regexp, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd rather call it regexps string
, flagVal sounds like unnecessary detail. regexpsCommaSeparated
could also work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind covering it with a simple unit test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind covering it with a simple unit test?
Added and moved to regexes.go
(felt weird to have unit tests under cmd/
)
Thanks a lot for the contribution. I added some comments. |
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetRegexpList(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3