{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/23014","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/23014/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/23014/comments","events_url":"https://api.github.com/repos/golang/go/issues/23014/events","html_url":"https://github.com/golang/go/issues/23014","id":279677926,"number":23014,"title":"Stringer Minor Bug","user":{"login":"henryas","id":14799603,"avatar_url":"https://avatars2.githubusercontent.com/u/14799603?v=4","gravatar_id":"","url":"https://api.github.com/users/henryas","html_url":"https://github.com/henryas","followers_url":"https://api.github.com/users/henryas/followers","following_url":"https://api.github.com/users/henryas/following{/other_user}","gists_url":"https://api.github.com/users/henryas/gists{/gist_id}","starred_url":"https://api.github.com/users/henryas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henryas/subscriptions","organizations_url":"https://api.github.com/users/henryas/orgs","repos_url":"https://api.github.com/users/henryas/repos","events_url":"https://api.github.com/users/henryas/events{/privacy}","received_events_url":"https://api.github.com/users/henryas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-06T09:13:03Z","updated_at":"2017-12-06T09:13:03Z","closed_at":null,"author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n\r\n### What version of Go are you using (`go version`)?\r\nGo 1.9.2\r\n\r\n### Does this issue reproduce with the latest release?\r\nYes\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nwindows 10 home, windows/amd64\r\n\r\n### What did you do?\r\n\r\nGiven the following data:\r\n```\r\ntype Lifespan uint64\r\n\r\nconst (\r\n\tNonDepreciable Lifespan = 0\r\n\tMonthLifespan Lifespan = 30\r\n\tYearLifespan Lifespan = 365\r\n)\r\n```\r\nthen run stringer on it (in this case, via go generate: //go:generate stringer -type=Lifespan)\r\n\r\n### What did you expect to see?\r\n```\r\n// Code generated by \"stringer -type=Lifespan\"; DO NOT EDIT.\r\n\r\npackage components\r\n\r\nimport \"strconv\"\r\n\r\nconst (\r\n\t_Lifespan_name_0 = \"NonDepreciable\"\r\n\t_Lifespan_name_1 = \"MonthLifespan\"\r\n\t_Lifespan_name_2 = \"YearLifespan\"\r\n)\r\n\r\nfunc (i Lifespan) String() string {\r\n\tswitch {\r\n\tcase i == 0:\r\n\t\treturn _Lifespan_name_0\r\n\tcase i == 30:\r\n\t\treturn _Lifespan_name_1\r\n\tcase i == 365:\r\n\t\treturn _Lifespan_name_2\r\n\tdefault:\r\n\t\treturn \"Lifespan(\" + strconv.FormatInt(int64(i), 10) + \")\"\r\n\t}\r\n}\r\n```\r\n\r\n### What did you see instead?\r\n```\r\n// Code generated by \"stringer -type=Lifespan\"; DO NOT EDIT.\r\n\r\npackage components\r\n\r\nimport \"strconv\"\r\n\r\nconst (\r\n\t_Lifespan_name_0 = \"NonDepreciable\"\r\n\t_Lifespan_name_1 = \"MonthLifespan\"\r\n\t_Lifespan_name_2 = \"YearLifespan\"\r\n)\r\n\r\nvar (\r\n\t_Lifespan_index_0 = [...]uint8{0, 14}\r\n\t_Lifespan_index_1 = [...]uint8{0, 13}\r\n\t_Lifespan_index_2 = [...]uint8{0, 12}\r\n)\r\n\r\nfunc (i Lifespan) String() string {\r\n\tswitch {\r\n\tcase i == 0:\r\n\t\treturn _Lifespan_name_0\r\n\tcase i == 30:\r\n\t\treturn _Lifespan_name_1\r\n\tcase i == 365:\r\n\t\treturn _Lifespan_name_2\r\n\tdefault:\r\n\t\treturn \"Lifespan(\" + strconv.FormatInt(int64(i), 10) + \")\"\r\n\t}\r\n}\r\n```\r\nThe Lifespan indexes are not necessary. \r\n\r\nI have fixed the bug, but I am not sure how to submit the file for review.\r\n\r\nThanks.\r\n\r\nHenry"}}
{"actor":{"display_login":"henryas"}}