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

parser: fix line skipping when key is empty #323

Merged
merged 2 commits into from
May 30, 2022

Conversation

gandarez
Copy link
Contributor

Describe the pull request

This PR fixes a scenario where the key name is zero length and readKeyName incorrectly handle it. Even if setting SkipUnrecognizableLines to true wasn't being skipped.

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code.

@codecov
Copy link

codecov bot commented May 30, 2022

Codecov Report

Merging #323 (a5af1b5) into main (e641746) will decrease coverage by 0.30%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
- Coverage   88.28%   87.98%   -0.31%     
==========================================
  Files           9        9              
  Lines        1349     1373      +24     
==========================================
+ Hits         1191     1208      +17     
- Misses         96       99       +3     
- Partials       62       66       +4     

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

One minor issue.

parser.go Outdated Show resolved Hide resolved
@gandarez gandarez requested a review from unknwon May 30, 2022 22:26
Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thanks for the followup!

@unknwon unknwon changed the title Fix line skipping when key is empty parser: fix line skipping when key is empty May 30, 2022
@unknwon unknwon merged commit 6098d42 into go-ini:main May 30, 2022
@unknwon
Copy link
Member

unknwon commented May 30, 2022

https://github.com/go-ini/ini/releases/tag/v1.66.6 has been tagged for this merge.

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