{"action":"created","issue":{"url":"https://api.github.com/repos/go-ini/ini/issues/16","labels_url":"https://api.github.com/repos/go-ini/ini/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/go-ini/ini/issues/16/comments","events_url":"https://api.github.com/repos/go-ini/ini/issues/16/events","html_url":"https://github.com/go-ini/ini/issues/16","id":109503202,"number":16,"title":"GetKey auto-creates all child sections","user":{"login":"johnl","id":5997,"avatar_url":"https://avatars.githubusercontent.com/u/5997?v=3","gravatar_id":"","url":"https://api.github.com/users/johnl","html_url":"https://github.com/johnl","followers_url":"https://api.github.com/users/johnl/followers","following_url":"https://api.github.com/users/johnl/following{/other_user}","gists_url":"https://api.github.com/users/johnl/gists{/gist_id}","starred_url":"https://api.github.com/users/johnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnl/subscriptions","organizations_url":"https://api.github.com/users/johnl/orgs","repos_url":"https://api.github.com/users/johnl/repos","events_url":"https://api.github.com/users/johnl/events{/privacy}","received_events_url":"https://api.github.com/users/johnl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/go-ini/ini/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-02T14:35:35Z","updated_at":"2015-10-02T15:51:37Z","closed_at":null,"body":"When calling GetKey in a section with dots in the section name, child sections are created.\r\n\r\nSo I have a ini file with a section with dots in the name:\r\n```\r\n[john@example.co.uk]\r\nid = bleh\r\n```\r\n\r\nI read the file in, modify the id key and write the file back out and end up with this:\r\n\r\n```\r\n[john@example.co.uk]\r\nid = bleh\r\n\r\n[john@example.co]\r\n\r\n[john@example]\r\n```\r\n\r\nI think the problem is here, where GetKey calls Section for all child nodes: https://github.com/go-ini/ini/blob/v1/ini.go#L516\r\n\r\nIt should instead check if each section exists, rather than auto-creating it.\r\n"},"comment":{"url":"https://api.github.com/repos/go-ini/ini/issues/comments/145069167","html_url":"https://github.com/go-ini/ini/issues/16#issuecomment-145069167","issue_url":"https://api.github.com/repos/go-ini/ini/issues/16","id":145069167,"user":{"login":"johnl","id":5997,"avatar_url":"https://avatars.githubusercontent.com/u/5997?v=3","gravatar_id":"","url":"https://api.github.com/users/johnl","html_url":"https://github.com/johnl","followers_url":"https://api.github.com/users/johnl/followers","following_url":"https://api.github.com/users/johnl/following{/other_user}","gists_url":"https://api.github.com/users/johnl/gists{/gist_id}","starred_url":"https://api.github.com/users/johnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnl/subscriptions","organizations_url":"https://api.github.com/users/johnl/orgs","repos_url":"https://api.github.com/users/johnl/repos","events_url":"https://api.github.com/users/johnl/events{/privacy}","received_events_url":"https://api.github.com/users/johnl/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T15:51:37Z","updated_at":"2015-10-02T15:51:37Z","body":"tested and looks good to me! Thanks!"}}