Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix Incorrect sed Regular Expression Handling Update tools.sh #1962

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xbryer
Copy link

@0xbryer 0xbryer commented Dec 22, 2024

Description

I noticed an issue with how a regular expression was used in a sed command within the bash script. Specifically, the expression:

sed 's/go*//'  

This approach has unintended behavior because the * in sed matches zero or more occurrences of the preceding character. As a result, it removes any sequence of g and o, which might not align with the intended functionality.

To address this, I updated the code to ensure it only removes the exact prefix go at the beginning of the string:

sed 's/^go//'  

Here’s the breakdown of the fix:

  • Added ^ to anchor the match to the start of the string.
  • Adjusted the expression to match go strictly at the beginning, avoiding accidental removal of unintended sequences.

Author Checklist

This correction ensures that the script behaves as expected and only removes the go prefix where necessary.

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

@0xbryer 0xbryer requested a review from a team as a code owner December 22, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant