{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/10252","labels_url":"https://api.github.com/repos/golang/go/issues/10252/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/10252/comments","events_url":"https://api.github.com/repos/golang/go/issues/10252/events","html_url":"https://github.com/golang/go/issues/10252","id":64396329,"number":10252,"title":"x/tools/cmd/eg: embedded fields are mishandled","user":{"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},"labels":[],"state":"open","locked":false,"assignee":{"login":"alandonovan","id":8433140,"avatar_url":"https://avatars.githubusercontent.com/u/8433140?v=3","gravatar_id":"","url":"https://api.github.com/users/alandonovan","html_url":"https://github.com/alandonovan","followers_url":"https://api.github.com/users/alandonovan/followers","following_url":"https://api.github.com/users/alandonovan/following{/other_user}","gists_url":"https://api.github.com/users/alandonovan/gists{/gist_id}","starred_url":"https://api.github.com/users/alandonovan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alandonovan/subscriptions","organizations_url":"https://api.github.com/users/alandonovan/orgs","repos_url":"https://api.github.com/users/alandonovan/repos","events_url":"https://api.github.com/users/alandonovan/events{/privacy}","received_events_url":"https://api.github.com/users/alandonovan/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/22","html_url":"https://github.com/golang/go/milestones/Unreleased","labels_url":"https://api.github.com/repos/golang/go/milestones/22/labels","id":1067491,"number":22,"title":"Unreleased","description":"Issues that do not affect released Go code and binaries.\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":346,"closed_issues":79,"state":"open","created_at":"2015-04-14T18:48:22Z","updated_at":"2015-07-18T18:00:38Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":3,"created_at":"2015-03-25T23:33:46Z","updated_at":"2015-07-19T20:43:31Z","closed_at":null,"body":"$GOPATH/src/egbug/x.go:\r\n\r\n```go\r\npackage egbug\r\n\r\ntype T struct {\r\n\t*E\r\n\tE2 *E\r\n}\r\n\r\ntype E struct {\r\n\tNext *T\r\n}\r\n\r\nfunc main() {\r\n\tvar t *T\r\n\tt.Next = new(T)\r\n}\r\n```\r\n\r\nTemplate:\r\n\r\n```go\r\npackage p\r\n\r\nimport \"egbug\"\r\n\r\nfunc before(t *egbug.T) *egbug.T { return t.Next }\r\nfunc after(t *egbug.T) *egbug.T  { return t.E2.Next }\r\n```\r\n\r\neg output:\r\n\r\n```go\r\npackage egbug\r\n\r\ntype T struct {\r\n\t*E\r\n\tE2\t*E\r\n}\r\n\r\ntype E struct {\r\n\tNext *T\r\n}\r\n\r\nfunc main() {\r\n\tvar t *T\r\n\tt.E2.E2.Next = new(T)\r\n}\r\n```\r\n\r\nThe second statement in main should be `t.E2.Next`, not `t.E2.E2.Next`. The output does not compile.\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/122705596","html_url":"https://github.com/golang/go/issues/10252#issuecomment-122705596","issue_url":"https://api.github.com/repos/golang/go/issues/10252","id":122705596,"user":{"login":"Ripounet","id":2892941,"avatar_url":"https://avatars.githubusercontent.com/u/2892941?v=3","gravatar_id":"","url":"https://api.github.com/users/Ripounet","html_url":"https://github.com/Ripounet","followers_url":"https://api.github.com/users/Ripounet/followers","following_url":"https://api.github.com/users/Ripounet/following{/other_user}","gists_url":"https://api.github.com/users/Ripounet/gists{/gist_id}","starred_url":"https://api.github.com/users/Ripounet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ripounet/subscriptions","organizations_url":"https://api.github.com/users/Ripounet/orgs","repos_url":"https://api.github.com/users/Ripounet/repos","events_url":"https://api.github.com/users/Ripounet/events{/privacy}","received_events_url":"https://api.github.com/users/Ripounet/received_events","type":"User","site_admin":false},"created_at":"2015-07-19T20:43:31Z","updated_at":"2015-07-19T20:43:31Z","body":"I noticed the same problem each time the \"after\" matches the \"before\" pattern, e.g. :\r\n```\r\nfunc before(str string) string { return strings.ToLower(str) }\r\nfunc after(str string) string  { return strings.ToLower(\"[\" + str + \"]\") }\r\n```\r\n-> brackets added twice instead of once."}}