Skip to content

Fix malformed source code link in the example app - #336

Open
maragubot wants to merge 1 commit into
maragudk:mainfrom
maragubot:garden/fix-example-app-source-link
Open

Fix malformed source code link in the example app#336
maragubot wants to merge 1 commit into
maragudk:mainfrom
maragubot:garden/fix-example-app-source-link

Conversation

@maragubot

Copy link
Copy Markdown
Contributor

What was found

The example app's home page rendered a link with a malformed scheme separator:

internal/examples/app/html/home.go:14 had href="https:/github.com/maragudk/gomponents/tree/main/internal/examples/app" — one slash after https: 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:/host back to https://host, which is why it went unnoticed, but net/url.Parse reads 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/app resolves, and the owner, repo, and main branch 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:

  • CI never builds the example app. .github/workflows/ci.yml runs go build ./... and go test ./... at the repo root, but internal/examples/app is 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.mod still requires maragu.dev/gomponents v1.0.0-beta1. Harmless today because go.work replaces it with the local checkout, but stale.

The `href` in `html.HomePage` was `https:/github.com/...`, with a single
slash after the scheme instead of two.
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (76f04c0) to head (433d302).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant