Skip to content

docs: improve deprecated comments; use go:fix inline#187

Open
alexandear wants to merge 1 commit intogofiber:masterfrom
alexandear-org:docs/improve-deprecated
Open

docs: improve deprecated comments; use go:fix inline#187
alexandear wants to merge 1 commit intogofiber:masterfrom
alexandear-org:docs/improve-deprecated

Conversation

@alexandear
Copy link
Copy Markdown

@alexandear alexandear commented Mar 13, 2026

This PR improves deprecated functions:

Before:

image

After:

image

Summary by CodeRabbit

  • Refactor
    • Updated deprecation notices for ToLowerBytes, ToUpperBytes, ToLower, and ToUpper functions with direct references to their replacements in the new utility package location. Users should migrate to the updated function paths for continued support.

@alexandear alexandear requested a review from a team as a code owner March 13, 2026 12:08
@alexandear alexandear requested review from ReneWerner87, efectn, gaby and sixcolors and removed request for a team March 13, 2026 12:08
@ReneWerner87 ReneWerner87 added the 📒 Documentation Improvements or additions to documentation label Mar 13, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the developer experience when dealing with deprecated utility functions. It updates the deprecation notices to provide clickable links to the recommended replacement functions in godoc, making it easier for users to navigate to the correct alternatives. Additionally, it introduces go:fix inline directives, enabling automated code migration for these deprecated functions, streamlining the update process for users.

Highlights

  • Improved Deprecation Comments: Deprecation comments for ToLowerBytes, ToUpperBytes, ToLower, and ToUpper functions were updated to use the new Go documentation link format, making them clickable in godoc.
  • Enabled go fix -inline Migration: The go:fix inline directive was added to the deprecated functions, allowing users to automatically migrate their code using go fix -inline.
Changelog
  • bytes.go
    • Updated ToLowerBytes deprecation comment to use [github.com/gofiber/utils/v2/bytes.UnsafeToLower] and added //go:fix inline.
    • Updated ToUpperBytes deprecation comment to use [github.com/gofiber/utils/v2/bytes.UnsafeToUpper] and added //go:fix inline.
  • strings.go
    • Updated ToLower deprecation comment to use [github.com/gofiber/utils/v2/strings.ToLower] and added //go:fix inline.
    • Updated ToUpper deprecation comment to use [github.com/gofiber/utils/v2/strings.ToUpper] and added //go:fix inline.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the deprecation notices for several functions in bytes.go and strings.go. The changes include updating the Deprecated comments to a format that generates clickable links in godoc, and adding the //go:fix inline directive to enable automatic code migration via go fix. The implementation aligns with the recommendations for using these Go features. No issues were found in the changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31eec824-2386-4fbe-8ac8-ea2c7a57220b

📥 Commits

Reviewing files that changed from the base of the PR and between ca61051 and a6f83d2.

📒 Files selected for processing (2)
  • bytes.go
  • strings.go
📜 Recent review details
🔇 Additional comments (4)
strings.go (2)

11-18: LGTM!

//go:fix inline directive enables "self-service API migration and upgrades." The deprecation comment uses the correct bracket link syntax for clickable godoc links, and the wrapper function (single return statement) is ideal for automated inlining. The signature matches the target strings.ToLower(s string) string from the context snippet.


20-27: LGTM!

Consistent with ToLower — correct bracket link format for godoc, valid //go:fix inline placement, and compatible signature with strings.ToUpper. The changes enable automated migration via go fix.

bytes.go (2)

11-19: LGTM!

The deprecation message now uses the clickable bracket link format while retaining the important backward compatibility note about slice mutation. The //go:fix inline directive enables "library authors to mark functions for automatic call-site inlining during migrations." The wrapper is a single return statement delegating to casebytes.UnsafeToLower, making it ideal for inlining with compatible signatures.


21-29: LGTM!

Consistent with ToLowerBytes — correct bracket link format, retained compatibility note, and valid //go:fix inline placement. The changes enable automated migration via go fix.


Walkthrough

Updates deprecation comments and adds //go:fix inline directives to utility functions in bytes and strings modules, guiding developers toward newer unsafe variants without altering any functionality.

Changes

Cohort / File(s) Summary
Deprecation and Go Fix Updates
bytes.go, strings.go
Updated deprecation comments to reference bracketed function paths (UnsafeToLower/UnsafeToUpper) and added //go:fix inline directives to facilitate automated migration of callers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

🧹 Updates

Suggested reviewers

  • ReneWerner87
  • sixcolors
  • gaby

Poem

🐰 The bytes and strings hop along with care,
Their deprecation notes now guide you there!
Go:fix directives point the weary way,
To unsafe variants, bright and gay! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: improving deprecated comments and adding go:fix inline directives to enable automated migration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📒 Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants