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(panic): fix panic when censoring utf-8 #64

Merged
merged 2 commits into from
Sep 21, 2023
Merged

fix(panic): fix panic when censoring utf-8 #64

merged 2 commits into from
Sep 21, 2023

Conversation

stephenduke-care
Copy link
Contributor

Summary
#43

Modified indexToRune to correctly count runes up to the given byte index. Adjusted Censor function to handle multi-byte characters properly, ensuring accurate index calculations during the censoring process. Updated incrementation of currentIndex to consider byte length, facilitating correct string iteration.

Checklist
Tested and/or added tests to validate that the changes work as intended, if applicable.
Updated documentation in README.md, if applicable.

Signed-off-by: stephenduke-care <stephen.duke@care.com>
Signed-off-by: stephenduke-care <stephen.duke@care.com>
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.52% 🎉

Comparison is base (8607c2b) 99.47% compared to head (cf3403d) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master       #64      +/-   ##
===========================================
+ Coverage   99.47%   100.00%   +0.52%     
===========================================
  Files           1         1              
  Lines         191       191              
===========================================
+ Hits          190       191       +1     
+ Misses          1         0       -1     
Files Changed Coverage Δ
goaway.go 100.00% <100.00%> (+0.52%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shinroo
Copy link

shinroo commented Sep 20, 2023

This is great, @TwiN what needs to be done to get this merged in?

@TwiN TwiN merged commit f76b6ad into TwiN:master Sep 21, 2023
1 check passed
@TwiN
Copy link
Owner

TwiN commented Sep 21, 2023

@shinroo Sorry about the delay!

@shinroo
Copy link

shinroo commented Sep 21, 2023

@shinroo Sorry about the delay!

No worries, thanks for the quick action. Great library you've got here!

@stephenduke-care stephenduke-care deleted the fix-utf-panic branch September 26, 2023 15:58
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.

4 participants