-
Notifications
You must be signed in to change notification settings - Fork 8
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
Converting Errorf to Fatalf #7
Conversation
WalkthroughThe changes primarily focus on enhancing error handling in the test functions of the certificate module. The modifications ensure immediate test failure upon encountering an error during certificate creation or writing, thereby preventing further execution and improving the reliability of the tests. Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- testcerts_test.go (5 hunks)
Additional comments (Suppressed): 5
testcerts_test.go (5)
31-34: The change from
Errorf
toFatalf
is appropriate here. If the temporary directory cannot be created, there's no point in continuing the test. This change ensures that the test fails immediately, which is a good practice in testing.40-55: The change from
Errorf
toFatalf
is also appropriate in these lines. If there's an error while generating certificates or checking if the certificate and key files exist, the test should fail immediately. This change enhances error reporting and prevents further test execution in the event of an error.120-123: The change from
Errorf
toFatalf
is appropriate here as well. If the temporary directory cannot be created, there's no point in continuing the test. This change ensures that the test fails immediately, which is a good practice in testing.346-355: The change from
Errorf
toFatalf
is also appropriate in these lines. If there's an error while generating key pairs or writing certificates to temporary files, the test should fail immediately. This change enhances error reporting and prevents further test execution in the event of an error.375-378: The change from
Error
toFatalf
is appropriate here. If therootCAs
function returns nil, the test should fail immediately. This change enhances error reporting and prevents further test execution in the event of an error.
Codecov Report
@@ Coverage Diff @@
## main #7 +/- ##
=======================================
Coverage 69.53% 69.53%
=======================================
Files 1 1
Lines 151 151
=======================================
Hits 105 105
Misses 25 25
Partials 21 21 |
Summary by CodeRabbit