8000 Parser removes ansible like comments · Issue #362 · go-ini/ini · GitHub
[go: up one dir, main page]

Skip to content

Parser removes ansible like comments #362

Closed

Description

@salemgolemugoo

Version

1.67.0

Describe the bug

Consider you have an ini file produced by Ansible's blockinfile

# BEGIN
[profile test]
sso_region              = us-east-1
sso_registration_scopes = sso:account:access
region                  = us-east-1
output                  = json
# END

If you add new sections at the end of the file the library is going to strip # END part and Ansible won't be able to recognize the text block anymore

To reproduce

Use the ini file provided in the description and try to add a new sections at the end of the file

Expected behavior

Keep the '# END' comment after the section

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. unknwon commented on Nov 11, 2026

    @unknwon
    Member

    Fixed in v2 by #435, and will be in the next v2 pre-release after v2.0.0-beta.2. v2 is imported as unknwon.dev/ini/v2; see the migration guide for upgrading from v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects
      37F6

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0