{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/13113","labels_url":"https://api.github.com/repos/golang/go/issues/13113/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/13113/comments","events_url":"https://api.github.com/repos/golang/go/issues/13113/events","html_url":"https://github.com/golang/go/issues/13113","id":114363804,"number":13113,"title":"cmd/gofmt: Faulty Comment Re-Arrangement in Argument Lists","user":{"login":"matttproud","id":46149,"avatar_url":"https://avatars.githubusercontent.com/u/46149?v=3","gravatar_id":"","url":"https://api.github.com/users/matttproud","html_url":"https://github.com/matttproud","followers_url":"https://api.github.com/users/matttproud/followers","following_url":"https://api.github.com/users/matttproud/following{/other_user}","gists_url":"https://api.github.com/users/matttproud/gists{/gist_id}","starred_url":"https://api.github.com/users/matttproud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matttproud/subscriptions","organizations_url":"https://api.github.com/users/matttproud/orgs","repos_url":"https://api.github.com/users/matttproud/repos","events_url":"https://api.github.com/users/matttproud/events{/privacy}","received_events_url":"https://api.github.com/users/matttproud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars.githubusercontent.com/u/8528975?v=3","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestones/Unplanned","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\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":1047,"closed_issues":146,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2015-10-31T00:23:47Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":2,"created_at":"2015-10-30T22:04:40Z","updated_at":"2015-10-31T04:35:32Z","closed_at":null,"body":"Hi,\r\n\r\nI noticed today that gofmt (on the Playground at least) reformats `/* */` comments that are inlined in argument lists inconsistently and in a non-faithful manner to their original ordering in the list:\r\n\r\n## Pre-Gofmt\r\n`fmt.Println(/* before first */ \"first\", /* before second */ \"second\")`\r\n[demo](http://play.golang.org/p/cBIcd0DWoC)\r\n\r\n## Post-Gofmt\r\n`fmt.Println( /* before first */ \"first\" /* before second */, \"second\")`\r\n[demo](http://play.golang.org/p/Ouu8UiHMmC)\r\n\r\nNotice how in the _Post-Gofmt_ case it moves the comment that occurred _after_ the comma to _before_.\r\n\r\nThis behavior is incongruent to what happens when the argument lists are spread across multiple lines:\r\n\r\n## Newline Distributed Pre-Gofmt\r\n```\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n\tfmt.Println(\r\n\t/* before first */ \"first\")\r\n\tfmt.Println(\r\n\t/* before first */ \"first\",\r\n\t/* before second */ \"second\")\t\r\n}\r\n```\r\n[demo](http://play.golang.org/p/A21ZkTDdmC)\r\n\r\n## Newline Distributed Post-Gofmt\r\n```\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n\tfmt.Println(\r\n\t\t/* before first */ \"first\")\r\n\tfmt.Println(\r\n\t\t/* before first */ \"first\",\r\n\t\t/* before second */ \"second\")\r\n}\r\n```\r\n[demo](http://play.golang.org/p/rtgoQRJO1w)\r\n\r\nFor the _pre_ cases, be sure to click `Format` in the Go Playground demo to see the post-state."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/152693597","html_url":"https://github.com/golang/go/issues/13113#issuecomment-152693597","issue_url":"https://api.github.com/repos/golang/go/issues/13113","id":152693597,"user":{"login":"dominikh","id":39825,"avatar_url":"https://avatars.githubusercontent.com/u/39825?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikh","html_url":"https://github.com/dominikh","followers_url":"https://api.github.com/users/dominikh/followers","following_url":"https://api.github.com/users/dominikh/following{/other_user}","gists_url":"https://api.github.com/users/dominikh/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikh/subscriptions","organizations_url":"https://api.github.com/users/dominikh/orgs","repos_url":"https://api.github.com/users/dominikh/repos","events_url":"https://api.github.com/users/dominikh/events{/privacy}","received_events_url":"https://api.github.com/users/dominikh/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T04:35:31Z","updated_at":"2015-10-31T04:35:31Z","body":"This looks like #9460."}}