🧹 chore: Fix typos in code and docs#3507
Conversation
WalkthroughThis update consists primarily of corrections to spelling, grammar, and naming consistency across code, tests, and documentation. Several error variable names and comments were fixed for clarity. A parameter in a generic function and related documentation was renamed for accuracy. No functional or control flow changes were introduced. Changes
Sequence Diagram(s)No sequence diagrams generated as all changes are related to naming, comments, and documentation without affecting control flow or introducing new features. Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3507 +/- ##
=======================================
Coverage 83.84% 83.84%
=======================================
Files 120 120
Lines 12278 12278
=======================================
Hits 10294 10294
Misses 1559 1559
Partials 425 425
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
The PR addresses multiple spelling and typo corrections across code, comments, and documentation.
- Renamed internal variables and error identifiers for correct English usage.
- Fixed typos in comments, error messages, and documentation titles/signatures.
- Updated signature parameter naming (
convertor→converter) and error constant spelling.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| prefork.go | Renamed childs to children |
| path_test.go | Corrected "charaters" → "characters" in comment |
| path.go | Fixed "segement" → "segment" in comment |
| middleware/static/static_test.go | Corrected "compressable" → "compressible" |
| middleware/earlydata/earlydata_test.go | Fixed "unsuported" → "unsupported" |
| middleware/cors/cors_test.go | Added apostrophe in "won't" |
| middleware/cors/cors.go | Fixed "Ommit" → "Omit" |
| listen.go | Corrected "certficate" → "certificate" |
| helpers.go | Renamed convertor → converter |
| docs/whats_new.md | Changed title to "What's New" |
| docs/middleware/encryptcookie.md | Fixed "Intitializes" → "Initializes" |
| docs/guide/utils.md | Renamed convertor → converter |
| docs/api/bind.md | Fixed "therefor" → "therefore" |
| ctx.go | Corrected "retured" → "returned" |
| binder/mapping_test.go | Fixed ErrMapNotConvertable → ErrMapNotConvertible in test |
| binder/mapping.go | Fixed return error ErrMapNotConvertable → ErrMapNotConvertible |
| binder/binder.go | Renamed ErrMapNotConvertable → ErrMapNotConvertible |
| bind_test.go | Updated test to use ErrMapNotConvertible |
Comments suppressed due to low confidence (1)
docs/guide/utils.md:16
- The documented signature shows a pointer return type
*Tbut the actualConvertfunction returns(T, error). Update the docs signature to match the implementation.
func Convert[T any](value string, converter func(string) (T, error), defaultValue ...T) (*T, error)
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/api/bind.md (1)
541-541: Refine punctuation around 'therefore' for clarity.Add a semicolon or comma before and after 'therefore' to improve readability. For example:
- This function does NOT panic therefore you must still return on error explicitly + This function does NOT panic; therefore, you must still return on error explicitly🧰 Tools
🪛 LanguageTool
[typographical] ~541-~541: The word “therefore” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...00 Bad Request`. This function does NOT panic therefore you must still return on error explicit...(THUS_SENTENCE)
helpers.go (1)
745-746: Parameter rename aligned with docs; add unit tests forConvert.Renamed
convertortoconverter, and updated its invocation. Please add unit tests to cover the newConvertfunction implementation.
Do you want me to generate a test suite for this function?🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 745-746: helpers.go#L745-L746
Added lines #L745 - L746 were not covered by tests
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
bind_test.go(1 hunks)binder/binder.go(1 hunks)binder/mapping.go(1 hunks)binder/mapping_test.go(1 hunks)ctx.go(1 hunks)docs/api/bind.md(1 hunks)docs/guide/utils.md(1 hunks)docs/middleware/encryptcookie.md(1 hunks)docs/whats_new.md(1 hunks)helpers.go(1 hunks)listen.go(1 hunks)middleware/cors/cors.go(1 hunks)middleware/cors/cors_test.go(1 hunks)middleware/earlydata/earlydata_test.go(1 hunks)middleware/static/static_test.go(5 hunks)path.go(1 hunks)path_test.go(1 hunks)prefork.go(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
binder/mapping.go (1)
binder/binder.go (1)
ErrMapNotConvertible(11-11)
binder/mapping_test.go (1)
binder/binder.go (1)
ErrMapNotConvertible(11-11)
bind_test.go (1)
binder/binder.go (1)
ErrMapNotConvertible(11-11)
🪛 GitHub Check: codecov/patch
binder/mapping.go
[warning] 116-116: binder/mapping.go#L116
Added line #L116 was not covered by tests
helpers.go
[warning] 745-746: helpers.go#L745-L746
Added lines #L745 - L746 were not covered by tests
🪛 LanguageTool
docs/api/bind.md
[typographical] ~541-~541: The word “therefore” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...00 Bad Request`. This function does NOT panic therefore you must still return on error explicit...
(THUS_SENTENCE)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Compare
- GitHub Check: unit (1.24.x, windows-latest)
- GitHub Check: repeated
🔇 Additional comments (24)
prefork.go (3)
79-81: Consistent renaming of map variable
Renamed the map fromchildsto the grammatically correctchildren. Declaration aligns with usage in subsequent code.
84-92: Updated references in deferred cleanup loop
Loop overchildreninstead of the oldchildsidentifier; logic for killing child processes remains unchanged.
118-122: Stored child process inchildrenmap
Assignment updated to usechildren[pid] = cmd. Verified no other references to the older variable name.middleware/cors/cors.go (1)
141-141: Fix typo in comment: "Omit"
Corrects the spelling from "Ommit" to "Omit" in the simple request CORS handling comment; no behavior change.path.go (1)
263-263: Fix typo in comment: "segment"
Updates the comment to correct "segement" to "segment" for clarity; functionality unaffected.path_test.go (1)
61-61: Fix typo in test comment: "characters"
Corrects the spelling in the heavy test case comment; no logic changes.docs/whats_new.md (1)
3-3: Add missing apostrophe in title
Updates the frontmatter title to "What's New in v3" to include the missing apostrophe.docs/middleware/encryptcookie.md (1)
16-16: Fix typo in comment: "Initializes"
Corrects the spelling in the middleware signature comment to "Initializes".ctx.go (1)
1756-1756: Typo fixed in comment.Corrected “retured” to “returned” in the Subdomains method comment.
middleware/cors/cors_test.go (1)
860-860: Fixed contraction in comment.Updated “wildcard wont set” to “wildcard won't set” for grammatical accuracy.
middleware/earlydata/earlydata_test.go (1)
52-52: Corrected spelling in error message.Changed “unsuported” to “unsupported” in the early-data middleware test.
listen.go (3)
75-79: Typo fix in CertFile comment
Corrected “certficate” to “certificate” for theCertFilefield, improving clarity and consistency.
81-85: Typo fix in CertKeyFile comment
Updated the comment to refer to the certificate’s private key correctly.
87-91: Typo fix in CertClientFile comment
Fixed “certficate” to “certificate” in theCertClientFilefield description.middleware/static/static_test.go (5)
743-743: Typo fix: non-compressible
Replaced “non-compressable” with the correct “non-compressible” spelling in the comment.
753-753: Typo fix: compressible
Updated “compressable” to the correct “compressible” in the comment.
775-775: Typo fix in Test_Static_Compress_WithoutEncoding
Corrected “compressable” to “compressible” in the test comment.
784-784: Typo fix: compressible context
Standardized the phrase “request compressible file with different encodings.”
830-830: Typo fix in Test_Static_Compress_WithFileSuffixes
Corrected comment to use “compressible” for consistency.binder/mapping_test.go (1)
153-156: Consistent error naming in test
Updated assertion to useErrMapNotConvertiblematching the renamed error constant.binder/mapping.go (2)
116-116: Consistent error constant usage
ReplacedErrMapNotConvertablewithErrMapNotConvertiblein the slice branch.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 116-116: binder/mapping.go#L116
Added line #L116 was not covered by tests
123-123: Consistent error constant usage
ReplacedErrMapNotConvertablewithErrMapNotConvertiblein the string/interface branch.bind_test.go (1)
150-153: Consistent error naming in bind_test
Updated the map error assertion to usebinder.ErrMapNotConvertible.binder/binder.go (1)
11-11: Typo in error variable corrected.Renamed
ErrMapNotConvertabletoErrMapNotConvertibleand updated the message to "map is not convertible". Consistency with other mapping error handling is maintained.
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 61b6875 | Previous: f9eec85 | Ratio |
|---|---|---|---|
Benchmark_SlashRecognition/forEach |
6.36 ns/op 0 B/op 0 allocs/op |
3.707 ns/op 0 B/op 0 allocs/op |
1.72 |
Benchmark_SlashRecognition/forEach - ns/op |
6.36 ns/op |
3.707 ns/op |
1.72 |
This comment was automatically generated by workflow using github-action-benchmark.
Summary