-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 missing error check of bufio.Scanner #29882
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.
Does scan: %w
help with debugging?
I know what |
* giteaofficial/main: Fix missing error check of bufio.Scanner (go-gitea#29882) Remove unused error in graceful manager (go-gitea#29871) Migrate border and margin classes to Tailwind (go-gitea#29828) Only do counting when count_only=true for repo dashboard (go-gitea#29884) Editor error message misleading due to re-used key. (go-gitea#29859) [skip ci] Updated licenses and gitignores move some scripts from 'build' to 'tools' directory, misc refactors (go-gitea#29844) Fix missing code in the user profile (go-gitea#29865) Upgrade Go 1.22 and upgrade dependency (go-gitea#29869) Fix the wrong locale key of searching users (go-gitea#29868) fix telegram webhook (go-gitea#29864) Fix user id column case (go-gitea#29863) Avoid JS error on issue/pr list when logged out (go-gitea#29854) Refactor clone-panel styles (go-gitea#29861) Simplify README (go-gitea#29827) Load citation JS only when needed (go-gitea#29855) Fix semantic.json (go-gitea#29860) # Conflicts: # templates/repo/wiki/revision.tmpl # templates/repo/wiki/view.tmpl
@@ -152,6 +152,10 @@ func RegeneratePublicKeys(ctx context.Context, t io.StringWriter) error { | |||
return err | |||
} | |||
} | |||
err = scanner.Err() | |||
if err != nil { | |||
return fmt.Errorf("scan: %w", err) |
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.
If it returns here, the f.Close
call is missing? Maybe resource leaking.
(And there seem to be more similar cases below)
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.
I agree, but this PR was merged.
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.
-> Fix some pending problems #29985
These changes are quite independent and trivial, so I don't want to open too many PRs. * #29882 (comment) * the `f.Close` should be called properly * the error message could be more meaningful (#29882 (review)) * #29859 (review) * the new translation strings don't take arguments * #28710 (comment) * stale for long time * #28140 * a form was forgotten to be changed to work with backend code
These changes are quite independent and trivial, so I don't want to open too many PRs. * go-gitea/gitea#29882 (comment) * the `f.Close` should be called properly * the error message could be more meaningful (go-gitea/gitea#29882 (review)) * go-gitea/gitea#29859 (review) * the new translation strings don't take arguments * go-gitea/gitea#28710 (comment) * stale for long time * #28140 * a form was forgotten to be changed to work with backend code (cherry picked from commit 226231ea27d4f2b0f09fa4efb39501507613b284) Conflicts: templates/repo/issue/view_content/pull.tmpl discarded because unexplained templates/status/404.tmpl implemented differently in Forgejo
maybe more