{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/13935","labels_url":"https://api.github.com/repos/golang/go/issues/13935/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/13935/comments","events_url":"https://api.github.com/repos/golang/go/issues/13935/events","html_url":"https://github.com/golang/go/issues/13935","id":126433082,"number":13935,"title":"proposal/RFC: continue for switch statements","user":{"login":"gabeio","id":643410,"avatar_url":"https://avatars.githubusercontent.com/u/643410?v=3","gravatar_id":"","url":"https://api.github.com/users/gabeio","html_url":"https://github.com/gabeio","followers_url":"https://api.github.com/users/gabeio/followers","following_url":"https://api.github.com/users/gabeio/following{/other_user}","gists_url":"https://api.github.com/users/gabeio/gists{/gist_id}","starred_url":"https://api.github.com/users/gabeio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabeio/subscriptions","organizations_url":"https://api.github.com/users/gabeio/orgs","repos_url":"https://api.github.com/users/gabeio/repos","events_url":"https://api.github.com/users/gabeio/events{/privacy}","received_events_url":"https://api.github.com/users/gabeio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/Go2","name":"Go2","color":"ffaaaa"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/30","html_url":"https://github.com/golang/go/milestones/Proposal","labels_url":"https://api.github.com/repos/golang/go/milestones/30/labels","id":1373555,"number":30,"title":"Proposal","description":"Proposals that are pending (not yet accepted/rejected).\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":14,"state":"open","created_at":"2015-10-24T01:40:49Z","updated_at":"2016-01-13T15:15:00Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-01-13T14:45:25Z","updated_at":"2016-01-13T19:27:02Z","closed_at":null,"body":"`continue` within a `switch` statement would continue checking cases below for their validity.\r\n\r\nThis would be in contrast to `fallthrough` which just executes all the other branches below, this only executes VALID branches below.\r\n\r\nan example of a fizzbuzz using the continue within switch:\r\n```go\r\npackage main\r\n\r\nfunc main(){\r\n\tfor i := 1; i<101; i++ {\r\n\t\tfizzbuzz(i)\r\n\t}\r\n}\r\n\r\nfunc fizzbuzz(num int) {\r\n\t// when num=15 all branches would be hit.\r\n\tfizzSwitch: switch {\r\n\tcase true:\r\n\t\tprint(num)\r\n\tcase num%3==0:\r\n\t\tprint(\"fizz\")\r\n\t\tcontinue fizzSwitch // continues to check other cases for true also\r\n\tcase num%5==0:\r\n\t\tprint(\"buzz\")\r\n\t\tcontinue fizzSwitch // continues to check other cases for true also\r\n\tcase true:\r\n\t\tprint(num)\r\n\t}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/171406473","html_url":"https://github.com/golang/go/issues/13935#issuecomment-171406473","issue_url":"https://api.github.com/repos/golang/go/issues/13935","id":171406473,"user":{"login":"minux","id":135652,"avatar_url":"https://avatars.githubusercontent.com/u/135652?v=3","gravatar_id":"","url":"https://api.github.com/users/minux","html_url":"https://github.com/minux","followers_url":"https://api.github.com/users/minux/followers","following_url":"https://api.github.com/users/minux/following{/other_user}","gists_url":"https://api.github.com/users/minux/gists{/gist_id}","starred_url":"https://api.github.com/users/minux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minux/subscriptions","organizations_url":"https://api.github.com/users/minux/orgs","repos_url":"https://api.github.com/users/minux/repos","events_url":"https://api.github.com/users/minux/events{/privacy}","received_events_url":"https://api.github.com/users/minux/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T19:27:02Z","updated_at":"2016-01-13T19:27:02Z","body":"If want to do this, why not use the more general if/else statement? Nothing\nis gained by using switch here.\n"}}