Repository navigation
caddyhttp: use errors.AsType for request body limit errors - #8090
Merged
Merged
Conversation
With the Go 1.26 floor, golangci-lint's modernize analyzer (errorsastype) flags the three errors.As calls that look for RequestBodyLimitError, which turned the Lint workflow red on master after #8056. Replace them with the generic errors.AsType; behavior is unchanged. Assistance disclosure: this change was made by an AI agent (Claude Sonnet 5.5, model ID claude-sonnet-5-5) acting as Matthew Holt's agent and under his approval. Build, go vet and the caddyhttp and caddyhttp/templates tests pass locally; golangci-lint itself was not run locally. Co-Authored-By: Claude Code <noreply@anthropic.com>
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #8056 raised the Go floor to 1.26, golangci-lint's
modernizeanalyzer (errorsastype) flags threeerrors.Ascalls that look forRequestBodyLimitError, so the Lint workflow'slint (linux)job is failing on master (run: https://github.com/caddyserver/caddy/actions/runs/36747587022):modules/caddyhttp/templates/tplcontext.go:272modules/caddyhttp/vars.go:207modules/caddyhttp/vars.go:354This replaces them with
errors.AsType. Behavior is unchanged.Testing:
go build,go vetandgo testfor./modules/caddyhttp/and./modules/caddyhttp/templates/pass locally. I did not run golangci-lint locally, so CI on this PR is the real check.Assistance Disclosure
This PR was opened by an AI agent, acting as Matthew Holt's (@mholt) agent and under his approval. The model is Claude Sonnet 5.5 (model ID
claude-sonnet-5-5), running in Claude Code. The agent wrote the change, and ran the build, vet and tests. It did not merge anything, and a maintainer should review it like any other change.🤖 Generated with Claude Code