Skip to content

Allow multiple whitespace between method & pattern#1013

Merged
VojtechVitek merged 1 commit intogo-chi:masterfrom
JRaspass:master
Aug 15, 2025
Merged

Allow multiple whitespace between method & pattern#1013
VojtechVitek merged 1 commit intogo-chi:masterfrom
JRaspass:master

Conversation

@JRaspass
Copy link
Contributor

@JRaspass JRaspass commented Aug 4, 2025

Allow separating the method and pattern with [ \t]+, this matches the stdlib change that was made in golang/go@7b583fd

The rationale is the same as the stdlib issue, it allows you to visually line up patterns with variable-width methods:

r.Handle("GET    /my-route", handler1)
r.Handle("POST   /my-route", handler2)
r.Handle("DELETE /my-route", handler3)

In general aligning ourselves with the stdlib brings less surprise for end users.

Allow separating the method and pattern with [ \t]+, this matches the
stdlib change that was made in golang/go@7b583fd

The rationale is the same as the stdlib issue, it allows you to visually
line up patterns with variable-width methods:

  r.Handle("GET    /my-route", handler1)
  r.Handle("POST   /my-route", handler2)
  r.Handle("DELETE /my-route", handler3)

In general aligning ourselves with the stdlib brings less surprise for
end users.
Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@VojtechVitek VojtechVitek merged commit 7859137 into go-chi:master Aug 15, 2025
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.

2 participants