• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / routegroup / 16864853501 / 1
98%
master: 98%

Build:
Build:
LAST BUILD BRANCH: fix-ci-caching
DEFAULT BRANCH: master
Ran 10 Aug 2025 06:16PM UTC
Files 1
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Aug 2025 06:11PM UTC coverage: 97.79% (+1.8%) from 95.977%
16864853501.1

push

github

web-flow
Fix issue #24: Empty Request.Pattern and double middleware execution (#25)

* Fix double middleware execution and empty Request.Pattern (#24)

This fixes two related issues:
1. Middleware was being called twice on root group with path params
2. Request.Pattern was empty when global middlewares executed

Root cause: middlewares were being applied both at route registration
time (in wrapMiddleware) and at serve time (via wrapGlobal).

The fix:
- Modified wrapMiddleware to skip applying middlewares for root bundle
  routes since they're applied globally in ServeHTTP
- Create a shallow copy of the request with Pattern set before applying
  global middlewares, ensuring middlewares can see the pattern
- Updated minimum Go version to 1.23 (required for setting Request.Pattern)

Added comprehensive tests to verify:
- Middleware is called exactly once
- Request.Pattern is properly set throughout the request lifecycle
- Multiple middlewares all see the correct pattern
- Both routes with and without path parameters work correctly

* Address review feedback: simplify code and fix outdated comment

- Remove outdated comment about disabling root not-found handler
- Simplify wrapMiddleware start-index logic for better readability
  by putting early return first and clarifying the child bundle logic

* Add comprehensive middleware tests

- Test PathValue accessibility in middlewares (documents expected behavior)
- Test middleware abort patterns for auth/security
- Test With() method middleware counting to prevent double execution
- Test response writer interception for logging/metrics
- Test context propagation through middleware chain
- Test middleware request property modifications

These tests ensure critical middleware behaviors are properly covered
to prevent regressions like issue #24.

* Simplify HandleRoot and HandleRootFunc comments

- Remove overly verbose and duplicated documentation
- Keep essential information in concise format
- Improve readability with... (continued)

177 of 181 relevant lines covered (97.79%)

48.52 hits per line

Source Files on job 16864853501.1
  • Tree
  • List 1
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 16864853501
  • 74f1c516 on github
  • Prev Job for on refs/tags/v1.5.2 (#16852076434.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc