Skip to content

Add parse float#134

Merged
ReneWerner87 merged 6 commits intomasterfrom
add_parse_float
Jul 13, 2025
Merged

Add parse float#134
ReneWerner87 merged 6 commits intomasterfrom
add_parse_float

Conversation

@ReneWerner87
Copy link
Member

@ReneWerner87 ReneWerner87 commented Jul 12, 2025

Benchmark_ParseFloat64/fiber-12               130381844        9.355 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat64/fiber-12               129132879        9.170 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat64/fiber_bytes-12         125142489        9.786 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat64/fiber_bytes-12         125434107        9.617 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat64/default-12              49301054        24.17 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat64/default-12              48115717        24.16 ns/op       0 B/op       0 allocs/op

Benchmark_ParseFloat32/fiber-12               100000000        10.11 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat32/fiber-12               100000000        10.14 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat32/fiber_bytes-12         100000000        10.44 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat32/fiber_bytes-12         100000000        10.61 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat32/default-12              46581891        25.97 ns/op       0 B/op       0 allocs/op
Benchmark_ParseFloat32/default-12              44455900        26.94 ns/op       0 B/op       0 allocs/op

Summary by CodeRabbit

  • New Features

    • Introduced a new function for parsing floating-point numbers from strings and byte slices.
    • Added comprehensive tests and benchmarks for the new float parsing functionality.
  • Documentation

    • Updated the README with improved formatting and added new benchmark results for float parsing.

```
Benchmark_ParseFloat/fiber-12                 100000000         11.18 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/fiber-12                 100000000         10.98 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/fiber_bytes-12           100000000         11.30 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/fiber_bytes-12           100000000         11.33 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/default-12                49387119         24.56 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/default-12                50058313         24.14 ns/op      0 B/op       0 allocs/op
```
@ReneWerner87 ReneWerner87 requested a review from a team as a code owner July 12, 2025 19:44
@ReneWerner87 ReneWerner87 requested review from efectn, gaby and sixcolors and removed request for a team July 12, 2025 19:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 12, 2025

Warning

Rate limit exceeded

@ReneWerner87 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cd052a7 and f9a902c.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • parse.go (2 hunks)
  • parse_test.go (2 hunks)

Walkthrough

A new ParseFloat function is introduced to parse decimal ASCII strings or byte slices into float64, handling various float formats and error conditions. Corresponding tests and benchmarks for this function are added. The README is updated to include and reformat benchmark results, now displaying the new float parsing benchmarks.

Changes

File(s) Change Summary
README.md Reformatted benchmark table and added results for Benchmark_ParseFloat.
parse.go Added the ParseFloat function for parsing decimal ASCII to float64.
parse_test.go Added tests and benchmarks for ParseFloat, covering various input cases and performance.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant ParseFloat
    participant math.Pow10

    Caller->>ParseFloat: ParseFloat(input)
    ParseFloat->>ParseFloat: Parse sign, integer, fraction, exponent
    ParseFloat->>math.Pow10: Compute exponent
    ParseFloat->>ParseFloat: Combine parts, check for errors
    ParseFloat-->>Caller: Return (float64, success)
Loading

Suggested labels

🧹 Updates

Suggested reviewers

  • gaby
  • sixcolors
  • efectn

Poem

In fields of bytes and floating dreams,
A rabbit hops and parses streams.
With tests and benchmarks, swift and neat,
Float numbers now, a tasty treat!
README shines with data bright—
Hippity-hop, the code feels right! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add_parse_float

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Summary of Changes

Hello @ReneWerner87, 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 introduces a new ParseFloat utility function to the codebase, designed for efficient parsing of floating-point numbers from string or byte slice inputs. The change includes the core implementation of this function, along with comprehensive unit tests to validate its behavior and performance benchmarks to compare its speed against the standard library's equivalent. The README.md has also been updated to reflect these new benchmark results.

Highlights

  • New Utility Function: Introduced ParseFloat, a new utility function capable of parsing decimal ASCII strings or byte slices into float64 values. This function supports optional signs, fractional parts, and exponents, and includes robust error and overflow handling.
  • Comprehensive Testing: Added dedicated unit tests (Test_ParseFloat) to ensure the correctness and robustness of the new ParseFloat function across various valid and invalid inputs, including edge cases like empty strings, invalid characters, and large exponents.
  • Performance Benchmarking: Included performance benchmarks (Benchmark_ParseFloat) to measure the efficiency of the new ParseFloat implementation. These benchmarks compare its performance when parsing from strings and byte slices against the standard library's strconv.ParseFloat.
  • Documentation Update: Updated the README.md file to include the benchmark results for the newly added ParseFloat function, providing immediate performance insights for users.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.

@codecov
Copy link

codecov bot commented Jul 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.68%. Comparing base (3885eba) to head (f9a902c).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   96.01%   96.68%   +0.66%     
==========================================
  Files          10       10              
  Lines         603      723     +120     
==========================================
+ Hits          579      699     +120     
  Misses         16       16              
  Partials        8        8              
Flag Coverage Δ
unittests 96.68% <100.00%> (+0.66%) ⬆️

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.

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 introduces a new, high-performance ParseFloat function. The implementation is a great start, and the benchmarks are impressive. My review provides feedback to improve correctness and robustness by addressing several edge cases, such as handling trailing decimal points and preventing silent precision loss. I've also suggested expanding the test suite to ensure the function is reliable across a wider variety of inputs.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30d51f5 and 54f8d38.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • parse.go (1 hunks)
  • parse_test.go (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ReneWerner87
PR: gofiber/fiber#2864
File: ctx_test.go:4816-4816
Timestamp: 2024-07-26T21:00:12.902Z
Learning: The `ParamsInt` function's behavior, including handling empty string parameters, will be addressed in future PRs as per ReneWerner87's guidance.
Learnt from: ReneWerner87
PR: gofiber/fiber#2864
File: ctx_test.go:4816-4816
Timestamp: 2024-10-08T19:06:06.583Z
Learning: The `ParamsInt` function's behavior, including handling empty string parameters, will be addressed in future PRs as per ReneWerner87's guidance.
Learnt from: ReneWerner87
PR: gofiber/fiber#0
File: :0-0
Timestamp: 2024-12-01T10:28:36.011Z
Learning: Feature request #3224 has been created to add support for square bracket notation and comma-separated values in multipart form data in Fiber, while maintaining binary data transfer capabilities. This would bring parity with the existing form-urlencoded functionality.
README.md (7)
Learnt from: ReneWerner87
PR: gofiber/fiber#3161
File: app.go:923-932
Timestamp: 2024-11-15T07:56:21.623Z
Learning: In the Fiber framework, breaking changes are acceptable when moving from version 2 to version 3, including modifications to method signatures such as in the `Test` method in `app.go`.
Learnt from: ReneWerner87
PR: gofiber/recipes#0
File: :0-0
Timestamp: 2024-11-26T20:05:15.793Z
Learning: For future contributions to the `gofiber/recipes` repository, ensure that the tasks outlined in `.github/CONTRIBUTING.md` are incorporated, including creating a new directory without a "fiber" prefix, adding a `README.md` with Docusaurus metadata, and updating the overview by running `make generate`.
Learnt from: juls0730
PR: gofiber/recipes#2710
File: tableflip/main.go:61-62
Timestamp: 2024-12-01T01:15:48.126Z
Learning: In the GoFiber `tableflip` recipe (`tableflip/main.go`), the implementation matches the upstream reference implementation. Future code suggestions should consider maintaining this alignment to ensure consistency.
Learnt from: norri
PR: gofiber/recipes#2701
File: clean-code/app/server/server.go:14-16
Timestamp: 2024-11-23T19:50:41.765Z
Learning: In the `clean-code` example at `clean-code/app/server/server.go` using the Go Fiber framework, it's acceptable to omit production-level features like context usage and graceful shutdown handling to keep the example simple.
Learnt from: ReneWerner87
PR: gofiber/storage#0
File: :0-0
Timestamp: 2025-02-12T11:24:31.153Z
Learning: The storage package in gofiber/storage repository can be used independently of the Fiber web framework.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/csrf/csrf_test.go:188-193
Timestamp: 2024-10-08T19:06:06.583Z
Learning: In the Fiber framework tests, using `ctx.Response.Header.Cookie` may not be suitable for parsing cookies from the response header, as it requires a `*Cookie` and fills it rather than returning a string value; thus, manual parsing of the `Set-Cookie` header may be necessary.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/csrf/csrf_test.go:188-193
Timestamp: 2024-09-25T15:57:10.221Z
Learning: In the Fiber framework tests, using `ctx.Response.Header.Cookie` may not be suitable for parsing cookies from the response header, as it requires a `*Cookie` and fills it rather than returning a string value; thus, manual parsing of the `Set-Cookie` header may be necessary.
parse_test.go (5)
Learnt from: efectn
PR: gofiber/fiber#3162
File: hooks_test.go:228-228
Timestamp: 2024-12-13T08:14:22.851Z
Learning: In Go test files, prefer using the `require` methods from the `testify` package for assertions instead of manual comparisons and calls to `t.Fatal` or `t.Fatalf`.
Learnt from: sixcolors
PR: gofiber/fiber#2922
File: middleware/cors/utils.go:63-71
Timestamp: 2024-10-08T19:06:06.583Z
Learning: The project uses the testify/assert package for assertions in unit tests.
Learnt from: sixcolors
PR: gofiber/fiber#2922
File: middleware/cors/utils.go:63-71
Timestamp: 2024-07-26T21:00:12.902Z
Learning: The project uses the testify/assert package for assertions in unit tests.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/store.go:164-167
Timestamp: 2024-10-02T23:03:31.727Z
Learning: Unit tests in this project use testify require.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/store.go:164-167
Timestamp: 2024-10-08T19:06:06.583Z
Learning: Unit tests in this project use testify require.
🧬 Code Graph Analysis (1)
parse_test.go (1)
parse.go (1)
  • ParseFloat (128-230)
🪛 GitHub Check: lint
parse_test.go

[failure] 424-424:
float-compare: use require.InEpsilon (or InDelta) (testifylint)


[failure] 415-415:
float-compare: use require.InEpsilon (or InDelta) (testifylint)

🪛 GitHub Actions: golangci-lint
parse_test.go

[error] 415-415: golangci-lint: float-compare: use require.InEpsilon (or InDelta) (testifylint)

🪛 GitHub Check: codecov/patch
parse.go

[warning] 138-139: parse.go#L138-L139
Added lines #L138 - L139 were not covered by tests


[warning] 142-143: parse.go#L142-L143
Added lines #L142 - L143 were not covered by tests


[warning] 153-154: parse.go#L153-L154
Added lines #L153 - L154 were not covered by tests


[warning] 164-165: parse.go#L164-L165
Added lines #L164 - L165 were not covered by tests


[warning] 184-185: parse.go#L184-L185
Added lines #L184 - L185 were not covered by tests


[warning] 187-191: parse.go#L187-L191
Added lines #L187 - L191 were not covered by tests


[warning] 194-195: parse.go#L194-L195
Added lines #L194 - L195 were not covered by tests


[warning] 199-200: parse.go#L199-L200
Added lines #L199 - L200 were not covered by tests


[warning] 213-214: parse.go#L213-L214
Added lines #L213 - L214 were not covered by tests

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Compare
🔇 Additional comments (3)
parse.go (1)

126-230: Good implementation with performance focus, but needs comprehensive test coverage.

The ParseFloat implementation is well-structured and handles various float formats correctly. However, static analysis indicates several edge cases are not covered by tests:

  1. Positive sign handling ("+123.45")
  2. Sign-only inputs ("+", "-")
  3. Integer overflow scenarios
  4. Decimal point at end ("123.")
  5. Exponent without digits ("123e", "123e+", "123e-")
  6. Invalid characters in exponent ("123e1a")

I recommend adding test cases for these scenarios to ensure robustness:

// Additional test cases for Test_ParseFloat
{"123.", 0, false},          // decimal point at end
{"+123.45", 123.45, true},   // positive sign
{"+", 0, false},             // sign only
{"123e", 0, false},          // exponent without digits
{"123e+", 0, false},         // exponent with sign only
{"123e-", 0, false},         // exponent with negative sign only
{"123e1a", 0, false},        // invalid exponent
{"1e-400", 0, true},         // underflow to zero
{"9999999999999999999", 0, false}, // integer overflow
README.md (1)

138-185: LGTM! Benchmark results clearly demonstrate the performance improvement.

The documentation accurately captures the ~2x performance gain of the new ParseFloat implementation compared to strconv.ParseFloat.

parse_test.go (1)

432-462: Well-structured benchmark implementation.

The benchmark effectively demonstrates the performance improvement of the new ParseFloat implementation compared to strconv.ParseFloat.

```
Benchmark_ParseFloat/fiber-12                 100000000         11.18 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/fiber-12                 100000000         10.98 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/fiber_bytes-12           100000000         11.30 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/fiber_bytes-12           100000000         11.33 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/default-12                49387119         24.56 ns/op      0 B/op       0 allocs/op
Benchmark_ParseFloat/default-12                50058313         24.14 ns/op      0 B/op       0 allocs/op
```
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
parse_test.go (2)

420-424: Fix inconsistent float comparison for zero values.

The special handling for zero values using require.Equal is unnecessary and causes linter failures. require.InEpsilon works correctly for zero values and should be used consistently for all float comparisons.

Apply this diff to fix the issue:

-		if ok {
-			if tt.val == 0 {
-				require.Equal(t, tt.val, v)
-			} else {
-				require.InEpsilon(t, tt.val, v, 1e-9)
-			}
-		}
+		if ok {
+			require.InEpsilon(t, tt.val, v, 1e-9)
+		}

429-433: Fix inconsistent float comparison for zero values in byte slice tests.

Same issue as the string tests - use require.InEpsilon consistently for all float comparisons.

Apply this diff to fix the issue:

-		if ok {
-			if tt.val == 0 {
-				require.Equal(t, tt.val, bts)
-			} else {
-				require.InEpsilon(t, tt.val, bts, 1e-9)
-			}
-		}
+		if ok {
+			require.InEpsilon(t, tt.val, bts, 1e-9)
+		}
🧹 Nitpick comments (1)
parse_test.go (1)

406-415: Good coverage of edge cases, but consider adding more comprehensive test cases.

The test cases cover important edge cases like trailing decimals ("1."), leading decimals (".5"), and various invalid inputs. However, based on the ParseFloat implementation, consider adding a few more edge cases to improve robustness:

Consider adding these additional test cases:

 		{"1e309", 0, false},
 		{"", 0, false},
 		{"abc", 0, false},
+		{"+123.45", 123.45, true},
+		{"+", 0, false},
+		{"-", 0, false},
+		{"123e", 0, false},
+		{"123e+", 0, false},
+		{"123e-", 0, false},
+		{"123e1a", 0, false},
+		{"1e-400", 0, true},
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54f8d38 and cd052a7.

📒 Files selected for processing (2)
  • parse.go (1 hunks)
  • parse_test.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • parse.go
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ReneWerner87
PR: gofiber/fiber#2864
File: ctx_test.go:4816-4816
Timestamp: 2024-07-26T21:00:12.902Z
Learning: The `ParamsInt` function's behavior, including handling empty string parameters, will be addressed in future PRs as per ReneWerner87's guidance.
Learnt from: ReneWerner87
PR: gofiber/fiber#2864
File: ctx_test.go:4816-4816
Timestamp: 2024-10-08T19:06:06.583Z
Learning: The `ParamsInt` function's behavior, including handling empty string parameters, will be addressed in future PRs as per ReneWerner87's guidance.
Learnt from: ReneWerner87
PR: gofiber/fiber#0
File: :0-0
Timestamp: 2024-12-01T10:28:36.011Z
Learning: Feature request #3224 has been created to add support for square bracket notation and comma-separated values in multipart form data in Fiber, while maintaining binary data transfer capabilities. This would bring parity with the existing form-urlencoded functionality.
parse_test.go (10)
Learnt from: efectn
PR: gofiber/fiber#3162
File: hooks_test.go:228-228
Timestamp: 2024-12-13T08:14:22.851Z
Learning: In Go test files, prefer using the `require` methods from the `testify` package for assertions instead of manual comparisons and calls to `t.Fatal` or `t.Fatalf`.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/store.go:164-167
Timestamp: 2024-10-02T23:03:31.727Z
Learning: Unit tests in this project use testify require.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/store.go:164-167
Timestamp: 2024-10-08T19:06:06.583Z
Learning: Unit tests in this project use testify require.
Learnt from: luk3skyw4lker
PR: gofiber/storage#1342
File: clickhouse/clickhouse.go:106-107
Timestamp: 2024-10-08T19:06:06.583Z
Learning: The `IsZero` function for `time.Time` structs in the ClickHouse storage driver was returning false even for zero value `time.Time` structs. As a result, a different verification logic was implemented to avoid bugs.
Learnt from: luk3skyw4lker
PR: gofiber/storage#1342
File: clickhouse/clickhouse.go:106-107
Timestamp: 2024-07-01T15:49:51.308Z
Learning: The `IsZero` function for `time.Time` structs in the ClickHouse storage driver was returning false even for zero value `time.Time` structs. As a result, a different verification logic was implemented to avoid bugs.
Learnt from: gaby
PR: gofiber/fiber#3170
File: ctx_test.go:1721-1724
Timestamp: 2024-10-16T12:12:30.506Z
Learning: In the Go unit tests in `ctx_test.go`, it is acceptable to use invalid CIDR notation such as `"0.0.0.1/31junk"` for testing purposes.
Learnt from: sixcolors
PR: gofiber/fiber#2922
File: middleware/cors/utils.go:63-71
Timestamp: 2024-10-08T19:06:06.583Z
Learning: The project uses the testify/assert package for assertions in unit tests.
Learnt from: sixcolors
PR: gofiber/fiber#2922
File: middleware/cors/utils.go:63-71
Timestamp: 2024-07-26T21:00:12.902Z
Learning: The project uses the testify/assert package for assertions in unit tests.
Learnt from: norri
PR: gofiber/recipes#2701
File: clean-code/app/datasources/database/db_mock.go:13-19
Timestamp: 2024-11-23T19:50:06.387Z
Learning: In test code within `clean-code/app/datasources/database/db_mock.go`, adding safety checks like context validation, safe type assertions, and extra documentation is not necessary.
Learnt from: juls0730
PR: gofiber/recipes#2710
File: tableflip/main.go:61-62
Timestamp: 2024-12-01T01:15:48.126Z
Learning: In the GoFiber `tableflip` recipe (`tableflip/main.go`), the implementation matches the upstream reference implementation. Future code suggestions should consider maintaining this alignment to ensure consistency.
🧬 Code Graph Analysis (1)
parse_test.go (1)
parse.go (1)
  • ParseFloat (128-227)
🪛 GitHub Check: lint
parse_test.go

[failure] 430-430:
float-compare: use require.InEpsilon (or InDelta) (testifylint)


[failure] 421-421:
float-compare: use require.InEpsilon (or InDelta) (testifylint)

🪛 GitHub Actions: golangci-lint
parse_test.go

[error] 421-421: golangci-lint: float-compare: use require.InEpsilon (or InDelta) (testifylint)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build (1.24.x, windows-latest)
  • GitHub Check: Build (1.24.x, ubuntu-latest)
  • GitHub Check: Build (1.24.x, macos-13)
  • GitHub Check: Build (1.23.x, macos-latest)
  • GitHub Check: Build (1.23.x, macos-13)
  • GitHub Check: Build (1.23.x, ubuntu-latest)
  • GitHub Check: Build (1.23.x, windows-latest)
  • GitHub Check: Analyse
  • GitHub Check: Compare
🔇 Additional comments (1)
parse_test.go (1)

438-468: LGTM - Benchmark implementation follows established patterns.

The benchmark implementation correctly follows the same pattern as other parsing benchmarks in the file, testing both string and byte slice variants against the standard library implementation.

@ReneWerner87 ReneWerner87 marked this pull request as draft July 12, 2025 22:19
@ReneWerner87 ReneWerner87 marked this pull request as ready for review July 13, 2025 12:19
@ReneWerner87 ReneWerner87 merged commit 16e0f56 into master Jul 13, 2025
17 of 18 checks passed
@gaby gaby deleted the add_parse_float branch July 13, 2025 14:15
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