{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12066","labels_url":"https://api.github.com/repos/golang/go/issues/12066/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12066/comments","events_url":"https://api.github.com/repos/golang/go/issues/12066/events","html_url":"https://github.com/golang/go/issues/12066","id":99673578,"number":12066,"title":"cmd/gofmt, internal/format: Gofmt function chaining with lambda issue","user":{"login":"Annonomus-Penguin","id":7022869,"avatar_url":"https://avatars.githubusercontent.com/u/7022869?v=3","gravatar_id":"","url":"https://api.github.com/users/Annonomus-Penguin","html_url":"https://github.com/Annonomus-Penguin","followers_url":"https://api.github.com/users/Annonomus-Penguin/followers","following_url":"https://api.github.com/users/Annonomus-Penguin/following{/other_user}","gists_url":"https://api.github.com/users/Annonomus-Penguin/gists{/gist_id}","starred_url":"https://api.github.com/users/Annonomus-Penguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Annonomus-Penguin/subscriptions","organizations_url":"https://api.github.com/users/Annonomus-Penguin/orgs","repos_url":"https://api.github.com/users/Annonomus-Penguin/repos","events_url":"https://api.github.com/users/Annonomus-Penguin/events{/privacy}","received_events_url":"https://api.github.com/users/Annonomus-Penguin/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/24","html_url":"https://github.com/golang/go/milestones/Go1.6","labels_url":"https://api.github.com/repos/golang/go/milestones/24/labels","id":1096159,"number":24,"title":"Go1.6","description":"","creator":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"open_issues":305,"closed_issues":50,"state":"open","created_at":"2015-05-05T02:39:06Z","updated_at":"2015-08-22T15:39:44Z","due_on":"2016-01-31T08:00:00Z","closed_at":null},"comments":2,"created_at":"2015-08-07T15:40:20Z","updated_at":"2015-08-23T09:55:45Z","closed_at":null,"body":"Take this code here:\r\n\r\n```go\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\ntype FoobarType struct{}\r\n\r\nfunc (ft *FoobarType) Run(f func()) *FoobarType {\r\n\tf()\r\n\treturn ft\r\n}\r\n\r\nfunc (ft *FoobarType) DoNothing() *FoobarType {\r\n\treturn ft\r\n}\r\n\r\nfunc main() {\r\n\tf := FoobarType{}\r\n\tf.Bar().\r\n\t\tDoNothing().\r\n\t\tRun(\r\n\t\t\tfunc() {\r\n\t\t\t\tfmt.Println(\"Hi\")\r\n\t\t\t},\r\n\t\t)\r\n}\r\n```\r\n\r\nThe issue is when I run `go fmt myproject`, it changes the main body to this:\r\n\r\n```go\r\nfunc main() {\r\n\tf := FoobarType{}\r\n\tf.Bar().\r\n\t\tDoNothing().\r\n\t\tRun(\r\n\t\tfunc() {\r\n\t\t\tfmt.Println(\"Hi\")\r\n\t\t},\r\n\t)\r\n}\r\n```\r\n\r\nLines 6-9 should be indented one line further. What is the cause of this?"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/133811632","html_url":"https://github.com/golang/go/issues/12066#issuecomment-133811632","issue_url":"https://api.github.com/repos/golang/go/issues/12066","id":133811632,"user":{"login":"mibk","id":2324898,"avatar_url":"https://avatars.githubusercontent.com/u/2324898?v=3","gravatar_id":"","url":"https://api.github.com/users/mibk","html_url":"https://github.com/mibk","followers_url":"https://api.github.com/users/mibk/followers","following_url":"https://api.github.com/users/mibk/following{/other_user}","gists_url":"https://api.github.com/users/mibk/gists{/gist_id}","starred_url":"https://api.github.com/users/mibk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mibk/subscriptions","organizations_url":"https://api.github.com/users/mibk/orgs","repos_url":"https://api.github.com/users/mibk/repos","events_url":"https://api.github.com/users/mibk/events{/privacy}","received_events_url":"https://api.github.com/users/mibk/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T09:55:45Z","updated_at":"2015-08-23T09:55:45Z","body":"Just to put another example, I would expect the following:\r\n```go\r\nfunc main() {\r\n\tf := FoobarType{}\r\n\tf.Bar().\r\n\t\tRun(func() {\r\n\t\tfmt.Println(\"Hi\")\r\n\t}).\r\n\t\tSet(map[string]interface{}{\r\n\t\t\"baz\": \"syd\",\r\n\t\t\"bag\": 13,\r\n\t})\r\n}\r\n```\r\nto rather look like this:\r\n```go\r\nfunc main() {\r\n\tf := FoobarType{}\r\n\tf.Bar().\r\n\t\tRun(func() {\r\n\t\t\tfmt.Println(\"Hi\")\r\n\t\t}).\r\n\t\tSet(map[string]interface{}{\r\n\t\t\t\"baz\": \"syd\",\r\n\t\t\t\"bag\": 13,\r\n\t\t})\r\n}\r\n```"}}