-
Notifications
You must be signed in to change notification settings - Fork 150
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
[plugin-mailq] mailq/postfix: Fix mail queue count regexp capture when it's 1
#1186
[plugin-mailq] mailq/postfix: Fix mail queue count regexp capture when it's 1
#1186
Conversation
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.
@yongjiajun Thank you, I think almost ok but please kindly confirm my suggestion
{mailqCount: 0}, | ||
{mailqCount: 1}, // #1185 | ||
} { | ||
os.Setenv("TEST_MAILQ_COUNT", strconv.Itoa(tc.mailqCount)) |
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.
[note] In general, Go 1.17 or higher, it would be better to use testing.T.Setenv.
But to keep consistency this use os.Setenv here intentionally because all test cases other than that still use os.Getenv.
Co-authored-by: KADOTA, Kyohei <lufia@users.noreply.github.com>
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.
We will release in a few days.
@lufia Thank you! |
Fixes #1185
This PR fixes the mail queue count regexp capture for Postfix when there's only 1 item in the mail queue.
Note/Update: The tests in the package modified are passing as I've tested them locally.