{"action":"closed","issue":{"url":"https://api.github.com/repos/gnewton/chidley/issues/33","repository_url":"https://api.github.com/repos/gnewton/chidley","labels_url":"https://api.github.com/repos/gnewton/chidley/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/gnewton/chidley/issues/33/comments","events_url":"https://api.github.com/repos/gnewton/chidley/issues/33/events","html_url":"https://github.com/gnewton/chidley/issues/33","id":308385382,"number":33,"title":"Type information of tags with -t flag does not work when collapsing tags with -F","user":{"login":"gnewton","id":793478,"avatar_url":"https://avatars0.githubusercontent.com/u/793478?v=4","gravatar_id":"","url":"https://api.github.com/users/gnewton","html_url":"https://github.com/gnewton","followers_url":"https://api.github.com/users/gnewton/followers","following_url":"https://api.github.com/users/gnewton/following{/other_user}","gists_url":"https://api.github.com/users/gnewton/gists{/gist_id}","starred_url":"https://api.github.com/users/gnewton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnewton/subscriptions","organizations_url":"https://api.github.com/users/gnewton/orgs","repos_url":"https://api.github.com/users/gnewton/repos","events_url":"https://api.github.com/users/gnewton/events{/privacy}","received_events_url":"https://api.github.com/users/gnewton/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-25T21:02:20Z","updated_at":"2018-03-25T21:29:01Z","closed_at":"2018-03-25T21:29:01Z","author_association":"OWNER","body":"When using both `-t` (use type information) and `-F` (collapse simple tags), only the collapsing is occurring, with no changes due to type information.\r\n\r\nExample XML:`data/typeCollapsing.xm`\r\n```\r\n  <record>\r\n    <name>Bill Smith</name>\r\n    <age>42</age>\r\n  </record>\r\n```\r\n\r\n### No flags:\r\n```\r\n$chidley  data/typeCollapsing.xml \r\ntype Cage struct {\r\n\tXMLName xml.Name`xml:\"age,omitempty\" json:\"age,omitempty\"`\r\n\tText string `xml:\",chardata\" json:\",omitempty\"`\r\n}\r\n\r\ntype Cname struct {\r\n\tXMLName xml.Name`xml:\"name,omitempty\" json:\"name,omitempty\"`\r\n\tText string `xml:\",chardata\" json:\",omitempty\"`\r\n}\r\n\r\ntype Crecord struct {\r\n\tXMLName xml.Name`xml:\"record,omitempty\" json:\"record,omitempty\"`\r\n\tCage *Cage `xml:\"age,omitempty\" json:\"age,omitempty\"`\r\n\tCname *Cname `xml:\"name,omitempty\" json:\"name,omitempty\"`\r\n}\r\n```\r\nThis is correct.\r\n\r\n### Use type information `-t`:\r\n```\r\n$chidley  -t data/typeCollapsing.xml \r\ntype Cage struct {\r\n\tXMLName xml.Name`xml:\"age,omitempty\" json:\"age,omitempty\"`\r\n\tNumber int8 `xml:\",chardata\" json:\",omitempty\"`\r\n}\r\n\r\ntype Cname struct {\r\n\tXMLName xml.Name`xml:\"name,omitempty\" json:\"name,omitempty\"`\r\n\tText string `xml:\",chardata\" json:\",omitempty\"`\r\n}\r\n\r\ntype Crecord struct {\r\n\tXMLName xml.Name`xml:\"record,omitempty\" json:\"record,omitempty\"`\r\n\tCage *Cage `xml:\"age,omitempty\" json:\"age,omitempty\"`\r\n\tCname *Cname `xml:\"name,omitempty\" json:\"name,omitempty\"`\r\n}\r\n```\r\nNote in `Cage Number int8 ` instead of `Cage Text string`\r\nThis is correct.\r\n\r\n### Collapse tags:\r\n```\r\n$chidley  -F data/typeCollapsing.xml \r\ntype Crecord struct {\r\n\tXMLName xml.Name`xml:\"record,omitempty\" json:\"record,omitempty\"`\r\n\tCage string `xml:\"age,omitempty\" json:\"age,omitempty\"`\r\n\tCname string `xml:\"name,omitempty\" json:\"name,omitempty\"`\r\n}\r\n```\r\n`Cage` and `Cname` are now variable fields not struct fields.\r\nThis is correct.\r\n\r\n### Collapse with type information:\r\n```\r\n$chidley  -F -t data/typeCollapsing.xml \r\ntype Crecord struct {\r\n\tXMLName xml.Name`xml:\"record,omitempty\" json:\"record,omitempty\"`\r\n\tCage string `xml:\"age,omitempty\" json:\"age,omitempty\"`\r\n\tCname string `xml:\"name,omitempty\" json:\"name,omitempty\"`\r\n}\r\n```\r\nThis is **not** correct.\r\n`Cage string` should be `Cage int8` "}}
{"actor":{"display_login":"gnewton"}}