{"action":"created","issue":{"url":"https://api.github.com/repos/pquerna/ffjson/issues/76","labels_url":"https://api.github.com/repos/pquerna/ffjson/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/pquerna/ffjson/issues/76/comments","events_url":"https://api.github.com/repos/pquerna/ffjson/issues/76/events","html_url":"https://github.com/pquerna/ffjson/issues/76","id":56964908,"number":76,"title":"Omitempty on pointer to value should only omit if not nil","user":{"login":"klauspost","id":5663952,"avatar_url":"https://avatars.githubusercontent.com/u/5663952?v=3","gravatar_id":"","url":"https://api.github.com/users/klauspost","html_url":"https://github.com/klauspost","followers_url":"https://api.github.com/users/klauspost/followers","following_url":"https://api.github.com/users/klauspost/following{/other_user}","gists_url":"https://api.github.com/users/klauspost/gists{/gist_id}","starred_url":"https://api.github.com/users/klauspost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauspost/subscriptions","organizations_url":"https://api.github.com/users/klauspost/orgs","repos_url":"https://api.github.com/users/klauspost/repos","events_url":"https://api.github.com/users/klauspost/events{/privacy}","received_events_url":"https://api.github.com/users/klauspost/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"klauspost","id":5663952,"avatar_url":"https://avatars.githubusercontent.com/u/5663952?v=3","gravatar_id":"","url":"https://api.github.com/users/klauspost","html_url":"https://github.com/klauspost","followers_url":"https://api.github.com/users/klauspost/followers","following_url":"https://api.github.com/users/klauspost/following{/other_user}","gists_url":"https://api.github.com/users/klauspost/gists{/gist_id}","starred_url":"https://api.github.com/users/klauspost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauspost/subscriptions","organizations_url":"https://api.github.com/users/klauspost/orgs","repos_url":"https://api.github.com/users/klauspost/repos","events_url":"https://api.github.com/users/klauspost/events{/privacy}","received_events_url":"https://api.github.com/users/klauspost/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-02-08T19:52:46Z","updated_at":"2015-02-09T15:44:59Z","closed_at":null,"body":"Right now pointer to values are omitted if the value is the zero type. For instance:\r\n```Go\r\ntype struct A {\r\n     Rp *bool      `json:\",omitempty\"`\r\n}\r\n[...]\r\n\tif mj.Rp != nil {\r\n\t\tif *mj.Rp != false { // <<--- Error ---This should not be done\r\n\t\t\tif *mj.Rp {\r\n\t\t\t\tbuf.WriteString(`\"Rp\":true`)\r\n\t\t\t} else {\r\n\t\t\t\tbuf.WriteString(`\"Rp\":false`)\r\n\t\t\t}\r\n\t\t}\r\n\t\tbuf.WriteByte(',')\r\n\t}\r\n[...]\r\n```\r\nI should have time to look at this tomorrow."},"comment":{"url":"https://api.github.com/repos/pquerna/ffjson/issues/comments/73530545","html_url":"https://github.com/pquerna/ffjson/issues/76#issuecomment-73530545","issue_url":"https://api.github.com/repos/pquerna/ffjson/issues/76","id":73530545,"user":{"login":"klauspost","id":5663952,"avatar_url":"https://avatars.githubusercontent.com/u/5663952?v=3","gravatar_id":"","url":"https://api.github.com/users/klauspost","html_url":"https://github.com/klauspost","followers_url":"https://api.github.com/users/klauspost/followers","following_url":"https://api.github.com/users/klauspost/following{/other_user}","gists_url":"https://api.github.com/users/klauspost/gists{/gist_id}","starred_url":"https://api.github.com/users/klauspost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauspost/subscriptions","organizations_url":"https://api.github.com/users/klauspost/orgs","repos_url":"https://api.github.com/users/klauspost/repos","events_url":"https://api.github.com/users/klauspost/events{/privacy}","received_events_url":"https://api.github.com/users/klauspost/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T15:44:59Z","updated_at":"2015-02-09T15:44:59Z","body":"Should be fixed by including PR #83."}}