Skip to content

Allow alternative delimiter for child sections #255

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

Merged
merged 1 commit into from
Aug 16, 2020

Conversation

irremotus
Copy link
Contributor

What problem should be fixed?

No problem exists. This feature is useful to me, and maybe to others: allowing to specify an alternative delimiter (instead of ".") for separating child section name components.

ini: added option for ChildSectionDelimiter
file: added default for ChildSectionDelimiter (".") to maintain current behavior by default
section:

  • append ChildSectionDelimiter instead of "." when checking if each section name begins with prefix
  • use ChildSectionDelimiter instead of "." when checking for LastIndex of delimiter

Have you added test cases to catch the problem?

Yes, the new feature is tested.

ini: added option for ChildSectionDelimiter
file: added default for ChildSectionDelimiter (".") to maintain current behavior by default
section:
  - append ChildSectionDelimiter instead of "." when checking if each section name begins with prefix
  - use ChildSectionDelimiter instead of "." when checking for LastIndex of delimiter
@codecov
Copy link

codecov bot commented Aug 9, 2020

Codecov Report

Merging #255 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #255      +/-   ##
==========================================
+ Coverage   86.25%   86.28%   +0.02%     
==========================================
  Files           9        9              
  Lines        1885     1888       +3     
==========================================
+ Hits         1626     1629       +3     
  Misses        198      198              
  Partials       61       61              
Impacted Files Coverage Δ
ini.go 71.42% <ø> (ø)
file.go 84.82% <100.00%> (+0.14%) ⬆️
section.go 96.64% <100.00%> (ø)

@unknwon unknwon linked an issue Aug 16, 2020 that may be closed by this pull request
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.

Thank you!

@unknwon unknwon merged commit 29f972a into go-ini:master Aug 16, 2020
@unknwon
Copy link
Member

unknwon commented Aug 16, 2020

v1.60.0 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.

Wrong section may be written if section name contains dot
2 participants