Skip to content

Cut SpaceBeforeInlineComment values at the earlier marker - #430

Merged
unknwon merged 1 commit into
go-ini:v1from
sarankumar1325:fix/space-before-inline-comment-order
Nov 11, 2026
Merged

unknwon merged 1 commit into
go-ini:v1from
sarankumar1325:fix/space-before-inline-comment-order

Conversation

@sarankumar1325

Copy link
Copy Markdown

With SpaceBeforeInlineComment, readValue looked for # first and only looked for ; when # was absent. A value such as foo ; note # ticket was kept as foo ; note.

The value is now cut at whichever of # or ; appears first, matching IndexAny when the option is off.

Fixes #426

Tests: a TestLoadSources case covers both marker orders. The full unit suite passes (go test .).

With SpaceBeforeInlineComment, readValue looked for " #" first and only
looked for " ;" when " #" was absent. A value such as "foo ; note # ticket"
kept the "; note" part. Cut at whichever of " #" or " ;" appears first,
matching IndexAny when the option is off.

Fixes go-ini#426

Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>
@unknwon
unknwon merged commit 2c9664c into go-ini:v1 Nov 11, 2026
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.

SpaceBeforeInlineComment cuts at " #" even when " ;" comes first

2 participants