Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

wanghaolong613
Copy link
Contributor

No description provided.

@hailaz hailaz requested a review from Copilot August 21, 2025 07:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the IsNumeric function where strings like "+.1" and "-.1" were incorrectly considered valid numeric values. The fix ensures that a decimal point must be preceded by a digit when it's not at the beginning of the string.

  • Fixed the decimal point validation logic to require a preceding digit
  • Added test cases to verify the fix for "+.1" and "-.1" edge cases

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/utils/utils_str.go Updated IsNumeric function to check that decimal points are preceded by digits
internal/utils/utils_z_unit_test.go Added test cases for "-.1" and "+.1" to verify they return false

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hailaz hailaz merged commit 24083b8 into gogf:master Aug 21, 2025
9 checks passed
@hailaz hailaz changed the title fix(utils/str): fix +.1 is pass checks numeric fix(internal/utils): fix +.1 is pass checks numeric Aug 21, 2025
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.

2 participants