Skip to content

Add heredoc multiline option - #457

Open
codedude wants to merge 3 commits into
go-ini:mainfrom
codedude:feature/heredoc-multiline
Open

codedude wants to merge 3 commits into
go-ini:mainfrom
codedude:feature/heredoc-multiline

Conversation

@codedude

@codedude codedude commented Nov 26, 2026 •

Copy link
Copy Markdown

Describe the pull request

The PR bring heredoc multiline read/write capability. It accepts any delimiter mostly like bash heredoc. It interprets the value as plain text, their is no substitution/transformation.

value = <<EOT
    line
EOT

I need this feature for a project at work (Packetfence, open source). So instead of re-implementing the whole thing or having a custom ini package, I would prefer use the standard one.

New option

AllowHeredocMultilineValues

I tried to not interfere with actual code, so unless AllowHeredocMultilineValues is set to true, you should expect the same behavior.
All tests pass, + I also ran the tests with AllowHeredocMultilineValues = true by default to prove it doesn't alter existing behavior, all tests also passed.

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.

AI usage

I used claude code to help for the write part only (2nd commit). It was mostly garbage so I fixed it all.
Note that I took the same to read and understand all the source code.

@codedude
codedude marked this pull request as ready for review November 26, 2026 16:29
@codedude
codedude requested a review from unknwon as a code owner November 26, 2026 16:29

This branch has not been deployed

No deployments
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.

1 participant