What's New
Trailing Slash Handling (#6)
Configurable trailing slash behavior via WithTrailingSlash():
router := fursy.New()
router.WithTrailingSlash(fursy.StripTrailingSlash)
router.GET("/api/companies", handler)
// GET /api/companies → 200
// GET /api/companies/ → 200 (silently stripped)Three modes:
IgnoreTrailingSlash(default) —/usersand/users/are distinct routesStripTrailingSlash— silently serves handler without redirectRedirectTrailingSlash— 301 (GET) / 308 (other methods) redirect to canonical URL
Bidirectional matching, query string preservation, HTTP-correct redirect codes.
ResponseWriter Flusher Fix (#7)
All ResponseWriter wrappers now implement http.Flusher and Unwrap():
- Logger, CircuitBreaker, OpenTelemetry tracing/metrics
- SSE streaming (
text/event-stream) now works correctly with middleware enabled
Code Quality
- Resolved all 48 golangci-lint issues — 0 issues across the entire codebase
- Test coverage: 93.8% → 94.6%
Performance
| Scenario | ns/op | allocs/op |
|---|---|---|
| Exact match (trailing slash ON) | 142 ns | 1 |
| Strip trailing slash (fallback) | 240 ns | 2 |
| Baseline (trailing slash OFF) | 131 ns | 1 |
Near-zero overhead on exact match path.
Full Changelog: v0.3.4...v0.4.0