Fix errcheck violation in RSS feed handler#22
Merged
Conversation
Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com>
…ssages Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com>
Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error return value of w.Write not checked
Fix errcheck violation in RSS feed handler
Mar 1, 2026
NickFoden
approved these changes
Mar 1, 2026
NickFoden
added a commit
that referenced
this pull request
Mar 2, 2026
* feat(quick-2): add About and GitHub links to site footer - Add footer_nav with /about and https://github.com/NickFoden links - GitHub link opens in new tab with rel="noopener noreferrer" - Style footer nav centered with flex layout and underline on hover * docs(quick-2): complete add-about-github-links-to-footer plan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(quick-2): Add about and github links to site footer * Tweak about * feat: update footer nav with GitHub icon, Feed link, and Sixtyfour font Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(quick-3): create plan for RSS feed at /feed.xml * feat(quick-3): add RSS feed handler to BlogHandler - Define rssItem, rssChannel, rssFeed structs using encoding/xml - Add Feed method that generates RSS 2.0 XML from h.posts - Set Content-Type to application/rss+xml; charset=utf-8 - Use time.RFC1123Z for pubDate and lastBuildDate * feat(quick-3): register /feed.xml route in main.go - Add r.Get("/feed.xml", blogHandler.Feed) alongside page routes - Activates the footer link that previously had no matching route * docs(quick-3): complete RSS feed plan summary and state update - 3-SUMMARY.md documents feed handler and route implementation - STATE.md updated with quick task 3 completion entry * Add the www * abc * Fix errcheck violation in RSS feed handler (#22) * Initial plan * Fix errcheck linting error by checking w.Write return values Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com> * Address code review feedback: combine writes and use generic error messages Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com> * Optimize slice allocation with pre-sized capacity Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: NickFoden <8321838+NickFoden@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Feedhandler ininternal/handlers/blog.gohad two uncheckedw.Write()calls, violating errcheck linting rules.Changes
w.Write()in the RSS feed handlererr.Error()to clientsBefore
After
Single write ensures atomicity—either the complete RSS feed is sent or nothing is written to the response body.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.