-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
refactor(scaler): compare error with errors.Is
#4004
Conversation
/run-e2e gcp* |
Nice improvement! Could you also update the other occurrences https://github.com/search?q=repo%3Akedacore%2Fkeda%20strings.Contains(err.Error()&type=code? |
@JorTurFer Sure! I'll push new commits soon |
errors.Is
errors.Is
@JorTurFer Please take a look again 😃 |
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.
Thanks for the improvement
Please @zroubalik , take a look too |
Starting from Go 1.13, errors.Is is the preferable way to compare error equality [1]. [1]: https://go.dev/blog/go1.13-errors Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.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.
LGTM, thanks!
/run-e2e |
Starting from Go 1.13, errors.Is is the preferable way to compare error equality.
Reference: https://go.dev/blog/go1.13-errors
Checklist
When introducing a new scaler, I agree with the scaling governance policyTests have been addedA PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)A PR is opened to update the documentation on (repo) (if applicable)