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

Fix error message on incorrect regexp #14

Merged
merged 3 commits into from
Oct 20, 2021

Conversation

mx-psi
Copy link
Contributor

@mx-psi mx-psi commented Oct 19, 2021

@@ -12,6 +12,21 @@ import (
"github.com/jcchavezs/porto"
)

func getRegexpList(flagVal string) ([]*regexp.Regexp, error) {
Copy link
Owner

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.

Copy link
Owner

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?

Copy link
Contributor Author

@mx-psi mx-psi Oct 20, 2021

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/)

@jcchavezs
Copy link
Owner

Thanks a lot for the contribution. I added some comments.

"github.com/stretchr/testify/assert"
)

func TestGetRegexpList(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@jcchavezs jcchavezs merged commit c81805b into jcchavezs:main Oct 20, 2021
@mx-psi mx-psi deleted the mx-psi/fix-err-msg branch October 20, 2021 18:51
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

Successfully merging this pull request may close these issues.

2 participants