Skip to content

style: use canonical header names in Get/Set string literals - #83

Merged
thomasdesr merged 1 commit into
mainfrom
thomas/canonical-etag
Sep 7, 2026
Merged

style: use canonical header names in Get/Set string literals#83
thomasdesr merged 1 commit into
mainfrom
thomas/canonical-etag

Conversation

@thomasdesr

Copy link
Copy Markdown
Owner

Header string literals passed to http.Header Get, Set, and Values now spell ETag and WWW-Authenticate the way they appear on the wire, instead of etag, Etag, and Www-Authenticate. http.Header canonicalizes keys on every call, so runtime behavior is identical.

This is the autofix golangci-lint v2.13.2's canonicalheader applies on CI, where it has been failing Lint on main since #81 landed. The linter does not report these sites when run against a Nix-built Go toolchain, which is why the hook passed locally before every merge today.

golangci-lint v2.13.2's canonicalheader recognizes ETag and
WWW-Authenticate as initialism headers and flags "etag", "Etag", and
"Www-Authenticate" literals. http.Header canonicalizes keys on every
Get/Set, so behavior is unchanged; the literals now read the way the
headers appear on the wire.
@thomasdesr
thomasdesr marked this pull request as ready for review September 7, 2026 22:57
@thomasdesr
thomasdesr merged commit fa44e6c into main Sep 7, 2026
5 checks passed
@thomasdesr
thomasdesr deleted the thomas/canonical-etag branch September 7, 2026 23:01
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.

1 participant