Skip to content

🧹 chore: Merge duplicate constants#3812

Merged
gaby merged 1 commit intogofiber:mainfrom
jsoref:remove-slash-delimiter-str
Oct 21, 2025
Merged

🧹 chore: Merge duplicate constants#3812
gaby merged 1 commit intogofiber:mainfrom
jsoref:remove-slash-delimiter-str

Conversation

@jsoref
Copy link
Contributor

@jsoref jsoref commented Oct 21, 2025

Description

Simplifies constants by folding two nearly identical constants into one

Changes introduced

List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.

  • Benchmarks: Describe any performance benchmarks and improvements related to the changes.
  • Documentation Update: Detail the updates made to the documentation and links to the changed files.
  • Changelog/What's New: Include a summary of the additions for the upcoming release notes.
  • Migration Guide: If necessary, provide a guide or steps for users to migrate their existing code to accommodate these changes.
  • API Alignment with Express: Explain how the changes align with the Express API.
  • API Longevity: Discuss the steps taken to ensure that the new or updated APIs are consistent and not prone to breaking changes.
  • Examples: Provide examples demonstrating the new features or changes in action.

Type of change

  • Code consistency (non-breaking change which improves code reliability and robustness)

Checklist

Before you submit your pull request, please make sure you meet these requirements:

  • Followed the inspiration of the Express.js framework for new functionalities, making them similar in usage.
  • Conducted a self-review of the code and provided comments for complex or critical parts.
  • Updated the documentation in the /docs/ directory for Fiber's documentation.
  • Added or updated unit tests to validate the effectiveness of the changes or new features.
  • Ensured that new and existing unit tests pass locally with the changes.
  • Verified that any new dependencies are essential and have been agreed upon by the maintainers/community.
  • Aimed for optimal performance with minimal allocations in the new code.
  • Provided benchmarks for the new code to analyze and improve upon.

Commit formatting

Please use emojis in commit messages for an easy way to identify the purpose or intention of a commit. Check out the emoji cheatsheet here: CONTRIBUTING.md

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
@jsoref jsoref requested a review from a team as a code owner October 21, 2025 20:25
@welcome
Copy link

welcome bot commented Oct 21, 2025

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Walkthrough

Refactored path.go to remove a redundant internal alias slashDelimiterStr and consolidate usage to the existing slashDelimiter constant. Both represented the same value (/), so this eliminates unnecessary duplication without altering functional behavior.

Changes

Cohort / File(s) Summary
Redundant constant cleanup
path.go
Removed internal alias slashDelimiterStr and updated addParameterMetaInfo to use existing slashDelimiter constant for trimming non-parameter segments

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A slash here, a slash there,
Two paths pointed everywhere!
But one was enough, it's true,
So we tidied up and said "adieu!"
Clean code hops along with care. 🌿

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed The PR description provides all required template sections and follows the structure appropriately. The main description clearly states the purpose: "Simplifies constants by folding two nearly identical constants into one," which aligns with the change summary. The type of change is correctly marked as "Code consistency," and the author has checked that a self-review was conducted. While several checklist items remain unchecked (documentation, unit tests, verification steps) and the "Fixes #" line is absent, these items are largely non-critical for a simple code refactoring that consolidates redundant constants with no functional behavioral change. The essential information needed to understand the PR's scope and intent is present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title Check ✅ Passed The pull request title "🧹 chore: Merge duplicate constants" directly aligns with the main change described in the raw summary: removing the redundant internal constant slashDelimiterStr and consolidating it with slashDelimiter. The title is clear, concise, and specific enough for a teammate to understand that this PR addresses constant consolidation without needing to convey every implementation detail. The emoji and conventional commit format enhance readability without introducing noise, and the title accurately represents the core refactoring objective of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jsoref, 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 aims to simplify the codebase by removing a redundant constant definition. It consolidates two identical byte constants, slashDelimiter and slashDelimiterStr, into a single slashDelimiter constant. This refactoring enhances code readability and maintainability without introducing any functional changes or breaking existing behavior.

Highlights

  • Constant Consolidation: The pull request merges two identical byte constants, slashDelimiter and slashDelimiterStr, into a single slashDelimiter constant to improve code consistency and reduce redundancy.
  • Code Consistency: This change is categorized as a code consistency improvement, ensuring that the codebase is more reliable and robust by eliminating duplicate definitions.
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
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 simplifies the code by removing the slashDelimiterStr constant, which was a duplicate of slashDelimiter. This is a good refactoring that improves maintainability and removes a potential source of confusion, as the ...Str suffix was misleading for a byte type constant. The change is implemented correctly by updating the usage to the remaining constant. No issues were found in this change.

@gaby gaby changed the title 🎨 Style: Merge duplicate constants 🧹 chore: Merge duplicate constants Oct 21, 2025
@gaby gaby added this to v3 Oct 21, 2025
@gaby gaby added this to the v3 milestone Oct 21, 2025
@gaby gaby moved this to In Progress in v3 Oct 21, 2025
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.88%. Comparing base (f669de4) to head (1a229ab).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3812      +/-   ##
==========================================
- Coverage   92.06%   91.88%   -0.19%     
==========================================
  Files         115      115              
  Lines       12257    12353      +96     
==========================================
+ Hits        11285    11350      +65     
- Misses        709      732      +23     
- Partials      263      271       +8     
Flag Coverage Δ
unittests 91.88% <100.00%> (-0.19%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@gaby gaby merged commit b00805c into gofiber:main Oct 21, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in v3 Oct 21, 2025
@welcome
Copy link

welcome bot commented Oct 21, 2025

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

@jsoref jsoref deleted the remove-slash-delimiter-str branch October 22, 2025 00:27
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