Fix malformed source code link in the example app - #336
Open
maragubot wants to merge 1 commit into
Open
Conversation
The `href` in `html.HomePage` was `https:/github.com/...`, with a single slash after the scheme instead of two.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #336 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 639 639
=========================================
Hits 639 639 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What was found
The example app's home page rendered a link with a malformed scheme separator:
internal/examples/app/html/home.go:14hadhref="https:/github.com/maragudk/gomponents/tree/main/internal/examples/app"— one slash afterhttps:instead of two.The README points users at this example app as "a more complete example", so it's a user-facing link. Browsers normalise
https:/hostback tohttps://host, which is why it went unnoticed, butnet/url.Parsereads it as an empty host with the whole thing as a path, so any stricter consumer follows it nowhere.The typo dates back to the v1 release commit, which rewrote the URL from
maragu.dev/gomponents/...to the GitHub form and dropped a slash in the process.What was fixed
Added the missing slash. One character, one line. The target
https://github.com/maragudk/gomponents/tree/main/internal/examples/appresolves, and the owner, repo, andmainbranch in it are all current.A repo-wide scan for the same bug class turns up no other occurrences.
Review notes
Clean review — no concerns raised.
Two pre-existing observations came up that are out of scope here and left for a future pass:
.github/workflows/ci.ymlrunsgo build ./...andgo test ./...at the repo root, butinternal/examples/appis a separate module (module app), so the root./...never reaches it. That's why a broken link could sit there indefinitely.internal/examples/app/go.modstill requiresmaragu.dev/gomponents v1.0.0-beta1. Harmless today becausego.workreplaces it with the local checkout, but stale.