Skip to content

docs: replace interface{} with any (Go 1.18+) - #4433

Merged
ReneWerner87 merged 2 commits into
gofiber:mainfrom
MD-Mushfiqur123:refactor/interface-to-any
Jun 15, 2026
Merged

ReneWerner87 merged 2 commits into
gofiber:mainfrom
MD-Mushfiqur123:refactor/interface-to-any

Conversation

@MD-Mushfiqur123

Copy link
Copy Markdown
Contributor

Replace interface{} with any across 4 files for Go 1.18+ compatibility.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8b2ddd97-4df8-4b35-a9d2-767d8653bac3

📥 Commits

Reviewing files that changed from the base of the PR and between 56193b2 and e0d96b9.

📒 Files selected for processing (1)
  • docs/middleware/session.md
✅ Files skipped from review due to trivial changes (1)
  • docs/middleware/session.md

Walkthrough

All changes replace the interface{} type alias with Go's equivalent any keyword across documentation comments in client/response.go and three documentation files (docs/guide/templates.md, docs/middleware/session.md, docs/whats_new.md). No method signatures, runtime logic, or functional behavior is changed.

Changes

interface{} → any terminology update

Layer / File(s) Summary
Response method doc comments
client/response.go
Doc comments for Response.JSON, Response.CBOR, and Response.XML updated to reference any instead of interface{}.
Docs: templates, session, whats_new
docs/guide/templates.md, docs/middleware/session.md, docs/whats_new.md
Views.Render, Engine.AddFunc, Engine.AddFuncMap signatures in template docs; RegisterType example and type list in session docs; and Format method description in whats_new all updated to use any in place of interface{}.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • gofiber/fiber#3270: Switches Ctx.Render's bind parameter to any, directly related to the template Views.Render signature update in this PR.
  • gofiber/fiber#3113: Also modifies docs/guide/templates.md for the Views Render method and Engine.AddFunc/AddFuncMap signatures.

Suggested labels

📒 Documentation, 🧹 Updates

Suggested reviewers

  • efectn
  • ReneWerner87

Poem

🐇 Hop, hop, through the code I go,
Swapping interface{} with any in a row,
The docs shine bright, the comments are clear,
No runtime changed — just tidy text here.
A small but tidy burrow, neat and true! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal and lacks required sections from the template such as changes introduced, type of change selection, and the complete checklist items. Expand the description to include checked boxes for 'Changes introduced' (Documentation Update), 'Type of change' (Code consistency), and confirm completion of relevant checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing interface{} with the any keyword across documentation and code files for Go 1.18+ compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ReneWerner87 ReneWerner87 added this to v3 Jun 15, 2026
@ReneWerner87 ReneWerner87 added this to the v3 milestone Jun 15, 2026
@ReneWerner87 ReneWerner87 changed the title refactor: replace interface{} with any (Go 1.18+) docs: replace interface{} with any (Go 1.18+) Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.39%. Comparing base (c6d692c) to head (e0d96b9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4433   +/-   ##
=======================================
  Coverage   91.39%   91.39%           
=======================================
  Files         134      134           
  Lines       13473    13473           
=======================================
  Hits        12314    12314           
  Misses        737      737           
  Partials      422      422           
Flag Coverage Δ
unittests 91.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/middleware/session.md`:
- Around line 474-475: The documentation example for store.RegisterType()
incorrectly shows the any keyword as an argument, which is not valid Go code
since any is a type keyword, not a value instance. Replace the any argument in
the store.RegisterType() function call with a concrete example of an actual type
instance (such as MyCustomType{}) to demonstrate the proper usage pattern and
help users understand how to correctly register their custom types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2172f581-c831-40b9-ad81-bc5cac62c3d7

📥 Commits

Reviewing files that changed from the base of the PR and between c6d692c and 56193b2.

📒 Files selected for processing (4)
  • client/response.go
  • docs/guide/templates.md
  • docs/middleware/session.md
  • docs/whats_new.md

Comment thread docs/middleware/session.md
Comment thread docs/middleware/session.md Outdated
@ReneWerner87
ReneWerner87 merged commit 15d2dc6 into gofiber:main Jun 15, 2026
16 checks passed
@welcome

welcome Bot commented Jun 15, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@github-project-automation github-project-automation Bot moved this to Done in v3 Jun 15, 2026
@ReneWerner87 ReneWerner87 modified the milestones: v3, v3.4.0 Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants