Skip to content

docs: correct Any godoc to reflect true arbitrary-method matching#3046

Merged
aldas merged 1 commit into
labstack:masterfrom
hyorimitsu:fix/any-docs-outdated
Jul 16, 2026
Merged

docs: correct Any godoc to reflect true arbitrary-method matching#3046
aldas merged 1 commit into
labstack:masterfrom
hyorimitsu:fix/any-docs-outdated

Conversation

@hyorimitsu

Copy link
Copy Markdown
Contributor

Summary

Fixes #3044.

The godoc for Echo.Any() said it only matches a specific set of known HTTP methods and is "not a true catch-any-arbitrary-method" way of matching. That's wrong — Any() registers a single RouteAny route that matches any HTTP method, including ones not known to Echo.

This PR fixes the docs to match the real behavior.

Changes

  • echo.go: Rewrite the Any() godoc; note that a method-specific route takes precedence.
  • router.go: Fix the AddRouteError comment to use Match() as the example.
  • echo_test.go: Add a test that an arbitrary method still matches the RouteAny fallback.

Notes

Docs and test only — no runtime behavior changes.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.42%. Comparing base (01b45be) to head (87bf4d7).
⚠️ Report is 32 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3046      +/-   ##
==========================================
+ Coverage   93.17%   93.42%   +0.24%     
==========================================
  Files          43       43              
  Lines        4501     4730     +229     
==========================================
+ Hits         4194     4419     +225     
- Misses        189      190       +1     
- Partials      118      121       +3     

☔ 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.

@aldas aldas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aldas
aldas merged commit 34f3f42 into labstack:master Jul 16, 2026
10 checks passed
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.

Echo.Any documentation is inconsistent with v5 router behavior

2 participants