{"action":"created","issue":{"url":"https://api.github.com/repos/abice/go-enum/issues/17","repository_url":"https://api.github.com/repos/abice/go-enum","labels_url":"https://api.github.com/repos/abice/go-enum/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/abice/go-enum/issues/17/comments","events_url":"https://api.github.com/repos/abice/go-enum/issues/17/events","html_url":"https://github.com/abice/go-enum/issues/17","id":326013262,"number":17,"title":"Error if ENUM starts from value = 1","user":{"login":"marusama","id":5119626,"avatar_url":"https://avatars2.githubusercontent.com/u/5119626?v=4","gravatar_id":"","url":"https://api.github.com/users/marusama","html_url":"https://github.com/marusama","followers_url":"https://api.github.com/users/marusama/followers","following_url":"https://api.github.com/users/marusama/following{/other_user}","gists_url":"https://api.github.com/users/marusama/gists{/gist_id}","starred_url":"https://api.github.com/users/marusama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marusama/subscriptions","organizations_url":"https://api.github.com/users/marusama/orgs","repos_url":"https://api.github.com/users/marusama/repos","events_url":"https://api.github.com/users/marusama/events{/privacy}","received_events_url":"https://api.github.com/users/marusama/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-24T08:22:09Z","updated_at":"2018-05-24T18:09:17Z","closed_at":null,"author_association":"NONE","body":"```\r\n// SearchPropertyType search property type\r\n// ENUM(\r\n// Apartment = 1\r\n// Room\r\n// House\r\n// Plot\r\n// Commercial\r\n// Development\r\n// )\r\ntype SearchPropertyType int32\r\n```\r\nproduces error: `Error=generate: error formatting code domain:358:59: expected ';', found 'IDENT' SearchPropertyType (and 4 more errors)`\r\ngenerated code:\r\n```\r\nconst (\r\n\t// SearchPropertyTypeApartment is a SearchPropertyType of type Apartment\r\n    SearchPropertyTypeApartment SearchPropertyType = iota SearchPropertyType = iota + 1\r\n\t// SearchPropertyTypeRoom is a SearchPropertyType of type Room\r\n    SearchPropertyTypeRoom  SearchPropertyType = iota + 1\r\n```\r\n\r\nproblematic code is here: https://github.com/abice/go-enum/blob/master/generator/enum.tmpl#L17\r\n\r\nworkaround for that is to add underscore as first value:\r\n```\r\n// SearchPropertyType search property type\r\n// ENUM(\r\n// _\r\n// Apartment = 1\r\n// Room\r\n// House\r\n// Plot\r\n// Commercial\r\n// Development\r\n// )\r\ntype SearchPropertyType int32\r\n```\r\nbut it will be great if it works without the workaround"},"comment":{"url":"https://api.github.com/repos/abice/go-enum/issues/comments/391808637","html_url":"https://github.com/abice/go-enum/issues/17#issuecomment-391808637","issue_url":"https://api.github.com/repos/abice/go-enum/issues/17","id":391808637,"user":{"login":"abice","id":5641848,"avatar_url":"https://avatars0.githubusercontent.com/u/5641848?v=4","gravatar_id":"","url":"https://api.github.com/users/abice","html_url":"https://github.com/abice","followers_url":"https://api.github.com/users/abice/followers","following_url":"https://api.github.com/users/abice/following{/other_user}","gists_url":"https://api.github.com/users/abice/gists{/gist_id}","starred_url":"https://api.github.com/users/abice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abice/subscriptions","organizations_url":"https://api.github.com/users/abice/orgs","repos_url":"https://api.github.com/users/abice/repos","events_url":"https://api.github.com/users/abice/events{/privacy}","received_events_url":"https://api.github.com/users/abice/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T18:09:17Z","updated_at":"2018-05-24T18:09:17Z","author_association":"OWNER","body":"Thanks for reporting, I'll take a look."}}
{"actor":{"display_login":"abice"}}