From the review pass on #3. The starter test suite landed there; these are the gaps left for another day.
main.go wiring (kong parsing, net.JoinHostPort) is untested. Extracting the body into a testable run() function would make it reachable.
CSV parsing edge cases: quoted fields / embedded commas, a UTF-8 BOM, CRLF line endings.
ServeHTTP with a non-GET method — it currently redirects regardless of method; decide whether that is wanted for POST and pin it with a test.
Broader (non-test) review notes — query-string handling, path normalisation, main.go panicking on user error, the Redirects.Find linear scan, CI on push, govulncheck pinning, a 0.0.0.0 host default, missing LICENSE — are in the review-notes comment on #3.
From the review pass on #3. The starter test suite landed there; these are the gaps left for another day.
- `main.go` wiring (kong parsing, `net.JoinHostPort`) is untested. Extracting the body into a testable `run()` function would make it reachable.
- CSV parsing edge cases: quoted fields / embedded commas, a UTF-8 BOM, CRLF line endings.
- `ServeHTTP` with a non-GET method — it currently redirects regardless of method; decide whether that is wanted for POST and pin it with a test.
Broader (non-test) review notes — query-string handling, path normalisation, `main.go` panicking on user error, the `Redirects.Find` linear scan, CI on push, `govulncheck` pinning, a `0.0.0.0` host default, missing LICENSE — are in the review-notes comment on #3.
Remove kong and just inline the function body. Make sure to retain support for the command-line options
Add CSV tests
We only want to redirect GET, HEAD and OPTIONS (I think? Whatever is conventional for a redirection service)
Create separate PRs for each of these.
- Remove kong and just inline the function body. Make sure to retain support for the command-line options
- Add CSV tests
- We only want to redirect GET, HEAD and OPTIONS (I think? Whatever is conventional for a redirection service)
Create separate PRs for each of these.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From the review pass on #3. The starter test suite landed there; these are the gaps left for another day.
main.gowiring (kong parsing,net.JoinHostPort) is untested. Extracting the body into a testablerun()function would make it reachable.ServeHTTPwith a non-GET method — it currently redirects regardless of method; decide whether that is wanted for POST and pin it with a test.Broader (non-test) review notes — query-string handling, path normalisation,
main.gopanicking on user error, theRedirects.Findlinear scan, CI on push,govulncheckpinning, a0.0.0.0host default, missing LICENSE — are in the review-notes comment on #3.Create separate PRs for each of these.