Skip to content

caddyhttp: use errors.AsType for request body limit errors - #8090

Merged
mholt merged 1 commit into
masterfrom
fix-lint-errors-astype
Sep 30, 2026
Merged

mholt merged 1 commit into
masterfrom
fix-lint-errors-astype

Conversation

@mholt

@mholt mholt commented Sep 30, 2026

Copy link
Copy Markdown
Member

After #8056 raised the Go floor to 1.26, golangci-lint's modernize analyzer (errorsastype) flags three errors.As calls that look for RequestBodyLimitError, so the Lint workflow's lint (linux) job is failing on master (run: https://github.com/caddyserver/caddy/actions/runs/36747587022):

  • modules/caddyhttp/templates/tplcontext.go:272
  • modules/caddyhttp/vars.go:207
  • modules/caddyhttp/vars.go:354

This replaces them with errors.AsType. Behavior is unchanged.

Testing: go build, go vet and go test for ./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

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>
@mholt
mholt merged commit 0a137e2 into master Sep 30, 2026
27 checks passed
@mholt
mholt deleted the fix-lint-errors-astype branch September 30, 2026 19:50
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