CodeVetter · Repo Unpack · Contributor handoff
labstack/echo
Begin with implementation and nearby tests, then use documentation to understand intended public compatibility. Tests and CI were inspected, not executed; future executable verification requires authorization outside this read-only investigation. Keep edits focused on the relevant interface or middleware and preserve cross-file dispatch, pooling, path, and response invariants. The inventory and test inspection are bounded, and risk observations must not be promoted into confirmed findings without verification.
- Use the /v5 import path and pointer Context handlers, with slog logging and Context-first callback signatures. The migration document describes these API changes, and current HandlerFunc/Binder declarations substantiate them.
- For dispatch changes, read New, buildRouterChains, serveHTTP, Context.Reset, and dispatch_pool_test.go together. Preserve Pre-before-routing, Use-after-routing, fallback-handler middleware execution, store clearing, and nested JSON writer behavior.
- For route syntax changes, inspect route_path.go, DefaultRouter.Add/Route, and RouteInfo.Reverse together: walkRoutePath is shared by registration and URL reversal, including escaped colons and inline verbs.
- For static-file changes, review both core StaticDirectoryHandler and Static middleware, plus encoded-separator regressions. Preserve path validation before and after optional decoding and the distinction between router-level 404 fallback and errors from matched handlers.
- For binding changes, preserve source precedence and method restrictions, explicit header binding, and separation of Bind from Validate. Changes to reflection source tags require synchronized metadata fields, tagName dispatch, and bindMetaFor extraction.
- For response wrappers, implement Unwrap so UnwrapResponse can reach Echo.Response, preserve delayed JSON commitment, and account for RequestLogger's default HandleError=true committing errors before outer middleware returns. Avoid assuming a returned error can replace an already sent response.
- If later execution is authorized, start with targeted tests in the changed package, then expand to package tests and go test -race ./... as appropriate. CI's inspected baseline uses race detection and atomic coverage; verify Makefile's package discovery before trusting make test or make race.
- Prefer config.ToMiddleware for new middleware validation and return request errors rather than swallowing them. Before altering BodyDump or proxyRaw, read their current downstream-input and connection-ownership behavior plus relevant tests; existing assertions describe intended behavior, not results of this investigation.