{"action":"created","comment":{"url":"https://api.github.com/repos/pquerna/ffjson/pulls/comments/24715644","id":24715644,"diff_hunk":"@@ -265,6 +266,38 @@ func getGetInnerValue(ic *Inception, name string, typ reflect.Type, ptr bool, fo\n \t\tout += \"buf.Write(obj)\" + \"\\n\"\n \tcase reflect.Map:\n \t\tout += getMapValue(ic, ptname, typ, ptr, forceString)\n+\tcase reflect.Struct:\n+\t\tif typ.Name() == \"\" {\n+\t\t\tic.q.Write(\"{\")\n+\t\t\tic.q.Write(\" \")\n+\t\t\tout += fmt.Sprintf(\"/* Inline struct. type=%v kind=%v */\\n\", typ, typ.Kind())\n+\t\t\tnewV := reflect.Indirect(reflect.New(typ)).Interface()\n+\t\t\tfields := extractFields(newV)","path":"inception/encoder.go","position":27,"original_position":27,"commit_id":"4749af564dcfdb94e9e2b9332343b2621bda74fd","original_commit_id":"4749af564dcfdb94e9e2b9332343b2621bda74fd","user":{"login":"pquerna","id":110123,"avatar_url":"https://avatars.githubusercontent.com/u/110123?v=3","gravatar_id":"","url":"https://api.github.com/users/pquerna","html_url":"https://github.com/pquerna","followers_url":"https://api.github.com/users/pquerna/followers","following_url":"https://api.github.com/users/pquerna/following{/other_user}","gists_url":"https://api.github.com/users/pquerna/gists{/gist_id}","starred_url":"https://api.github.com/users/pquerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pquerna/subscriptions","organizations_url":"https://api.github.com/users/pquerna/orgs","repos_url":"https://api.github.com/users/pquerna/repos","events_url":"https://api.github.com/users/pquerna/events{/privacy}","received_events_url":"https://api.github.com/users/pquerna/received_events","type":"User","site_admin":false},"body":"wow. it goes deeper.\r\n\r\n![](http://24.media.tumblr.com/tumblr_lbql4uBeCq1qd7m1so1_500.gif)\r\n","created_at":"2015-02-14T17:09:08Z","updated_at":"2015-02-14T17:09:08Z","html_url":"https://github.com/pquerna/ffjson/pull/93#discussion_r24715644","pull_request_url":"https://api.github.com/repos/pquerna/ffjson/pulls/93","_links":{"self":{"href":"https://api.github.com/repos/pquerna/ffjson/pulls/comments/24715644"},"html":{"href":"https://github.com/pquerna/ffjson/pull/93#discussion_r24715644"},"pull_request":{"href":"https://api.github.com/repos/pquerna/ffjson/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/pquerna/ffjson/pulls/93","id":29321287,"html_url":"https://github.com/pquerna/ffjson/pull/93","diff_url":"https://github.com/pquerna/ffjson/pull/93.diff","patch_url":"https://github.com/pquerna/ffjson/pull/93.patch","issue_url":"https://api.github.com/repos/pquerna/ffjson/issues/93","number":93,"state":"open","locked":false,"title":"Generate inline structs for encoder.","user":{"login":"klauspost","id":5663952,"avatar_url":"https://avatars.githubusercontent.com/u/5663952?v=3","gravatar_id":"","url":"https://api.github.com/users/klauspost","html_url":"https://github.com/klauspost","followers_url":"https://api.github.com/users/klauspost/followers","following_url":"https://api.github.com/users/klauspost/following{/other_user}","gists_url":"https://api.github.com/users/klauspost/gists{/gist_id}","starred_url":"https://api.github.com/users/klauspost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauspost/subscriptions","organizations_url":"https://api.github.com/users/klauspost/orgs","repos_url":"https://api.github.com/users/klauspost/repos","events_url":"https://api.github.com/users/klauspost/events{/privacy}","received_events_url":"https://api.github.com/users/klauspost/received_events","type":"User","site_admin":false},"body":"This will generate code for inline structs.\r\n\r\nCommon Go json -> struct generators  [jsonstruct.com](http://www.jsonstruct.com/) generate code like this:\r\n```Go\r\ntype ExampleStruct struct {\r\n\tHref     string `json:\"href\"`\r\n\tKommuner []struct {\r\n\t\tHref string `json:\"href\"`\r\n\t\tKode string `json:\"kode\"`\r\n\t\tNavn string `json:\"navn\"`\r\n\t} `json:\"kommuner\"`\r\n\tNavn      string `json:\"navn\"`\r\n\tPostnumre []struct {\r\n\t\tHref string `json:\"href\"`\r\n\t\tNavn string `json:\"navn\"`\r\n\t\tNr   string `json:\"nr\"`\r\n\t} `json:\"postnumre\"`\r\n}\r\n```\r\nHere ffjson would fall back to using json.Marshal, but it will now generate inline code for these. All ffjson types are supported, even structs within structs (more inception).","created_at":"2015-02-14T15:15:38Z","updated_at":"2015-02-14T17:09:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56584fc6817158ccceb85e0d6e3c98cc7c888482","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pquerna/ffjson/pulls/93/commits","review_comments_url":"https://api.github.com/repos/pquerna/ffjson/pulls/93/comments","review_comment_url":"https://api.github.com/repos/pquerna/ffjson/pulls/comments/{number}","comments_url":"https://api.github.com/repos/pquerna/ffjson/issues/93/comments","statuses_url":"https://api.github.com/repos/pquerna/ffjson/statuses/4749af564dcfdb94e9e2b9332343b2621bda74fd","head":{"label":"klauspost:generate-inline-structs","ref":"generate-inline-structs","sha":"4749af564dcfdb94e9e2b9332343b2621bda74fd","user":{"login":"klauspost","id":5663952,"avatar_url":"https://avatars.githubusercontent.com/u/5663952?v=3","gravatar_id":"","url":"https://api.github.com/users/klauspost","html_url":"https://github.com/klauspost","followers_url":"https://api.github.com/users/klauspost/followers","following_url":"https://api.github.com/users/klauspost/following{/other_user}","gists_url":"https://api.github.com/users/klauspost/gists{/gist_id}","starred_url":"https://api.github.com/users/klauspost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauspost/subscriptions","organizations_url":"https://api.github.com/users/klauspost/orgs","repos_url":"https://api.github.com/users/klauspost/repos","events_url":"https://api.github.com/users/klauspost/events{/privacy}","received_events_url":"https://api.github.com/users/klauspost/received_events","type":"User","site_admin":false},"repo":{"id":19896257,"name":"ffjson","full_name":"klauspost/ffjson","owner":{"login":"klauspost","id":5663952,"avatar_url":"https://avatars.githubusercontent.com/u/5663952?v=3","gravatar_id":"","url":"https://api.github.com/users/klauspost","html_url":"https://github.com/klauspost","followers_url":"https://api.github.com/users/klauspost/followers","following_url":"https://api.github.com/users/klauspost/following{/other_user}","gists_url":"https://api.github.com/users/klauspost/gists{/gist_id}","starred_url":"https://api.github.com/users/klauspost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauspost/subscriptions","organizations_url":"https://api.github.com/users/klauspost/orgs","repos_url":"https://api.github.com/users/klauspost/repos","events_url":"https://api.github.com/users/klauspost/events{/privacy}","received_events_url":"https://api.github.com/users/klauspost/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/klauspost/ffjson","description":"freaking fast JSON serialization for Go / Golang","fork":true,"url":"https://api.github.com/repos/klauspost/ffjson","forks_url":"https://api.github.com/repos/klauspost/ffjson/forks","keys_url":"https://api.github.com/repos/klauspost/ffjson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/klauspost/ffjson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/klauspost/ffjson/teams","hooks_url":"https://api.github.com/repos/klauspost/ffjson/hooks","issue_events_url":"https://api.github.com/repos/klauspost/ffjson/issues/events{/number}","events_url":"https://api.github.com/repos/klauspost/ffjson/events","assignees_url":"https://api.github.com/repos/klauspost/ffjson/assignees{/user}","branches_url":"https://api.github.com/repos/klauspost/ffjson/branches{/branch}","tags_url":"https://api.github.com/repos/klauspost/ffjson/tags","blobs_url":"https://api.github.com/repos/klauspost/ffjson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/klauspost/ffjson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/klauspost/ffjson/git/refs{/sha}","trees_url":"https://api.github.com/repos/klauspost/ffjson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/klauspost/ffjson/statuses/{sha}","languages_url":"https://api.github.com/repos/klauspost/ffjson/languages","stargazers_url":"https://api.github.com/repos/klauspost/ffjson/stargazers","contributors_url":"https://api.github.com/repos/klauspost/ffjson/contributors","subscribers_url":"https://api.github.com/repos/klauspost/ffjson/subscribers","subscription_url":"https://api.github.com/repos/klauspost/ffjson/subscription","commits_url":"https://api.github.com/repos/klauspost/ffjson/commits{/sha}","git_commits_url":"https://api.github.com/repos/klauspost/ffjson/git/commits{/sha}","comments_url":"https://api.github.com/repos/klauspost/ffjson/comments{/number}","issue_comment_url":"https://api.github.com/repos/klauspost/ffjson/issues/comments/{number}","contents_url":"https://api.github.com/repos/klauspost/ffjson/contents/{+path}","compare_url":"https://api.github.com/repos/klauspost/ffjson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/klauspost/ffjson/merges","archive_url":"https://api.github.com/repos/klauspost/ffjson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/klauspost/ffjson/downloads","issues_url":"https://api.github.com/repos/klauspost/ffjson/issues{/number}","pulls_url":"https://api.github.com/repos/klauspost/ffjson/pulls{/number}","milestones_url":"https://api.github.com/repos/klauspost/ffjson/milestones{/number}","notifications_url":"https://api.github.com/repos/klauspost/ffjson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/klauspost/ffjson/labels{/name}","releases_url":"https://api.github.com/repos/klauspost/ffjson/releases{/id}","created_at":"2014-05-17T21:02:51Z","updated_at":"2014-10-16T13:24:38Z","pushed_at":"2015-02-14T15:30:50Z","git_url":"git://github.com/klauspost/ffjson.git","ssh_url":"git@github.com:klauspost/ffjson.git","clone_url":"https://github.com/klauspost/ffjson.git","svn_url":"https://github.com/klauspost/ffjson","homepage":"","size":630,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"pquerna:master","ref":"master","sha":"50049f17e949eca45cff7aada1e8c6ab5d26ccac","user":{"login":"pquerna","id":110123,"avatar_url":"https://avatars.githubusercontent.com/u/110123?v=3","gravatar_id":"","url":"https://api.github.com/users/pquerna","html_url":"https://github.com/pquerna","followers_url":"https://api.github.com/users/pquerna/followers","following_url":"https://api.github.com/users/pquerna/following{/other_user}","gists_url":"https://api.github.com/users/pquerna/gists{/gist_id}","starred_url":"https://api.github.com/users/pquerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pquerna/subscriptions","organizations_url":"https://api.github.com/users/pquerna/orgs","repos_url":"https://api.github.com/users/pquerna/repos","events_url":"https://api.github.com/users/pquerna/events{/privacy}","received_events_url":"https://api.github.com/users/pquerna/received_events","type":"User","site_admin":false},"repo":{"id":17944871,"name":"ffjson","full_name":"pquerna/ffjson","owner":{"login":"pquerna","id":110123,"avatar_url":"https://avatars.githubusercontent.com/u/110123?v=3","gravatar_id":"","url":"https://api.github.com/users/pquerna","html_url":"https://github.com/pquerna","followers_url":"https://api.github.com/users/pquerna/followers","following_url":"https://api.github.com/users/pquerna/following{/other_user}","gists_url":"https://api.github.com/users/pquerna/gists{/gist_id}","starred_url":"https://api.github.com/users/pquerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pquerna/subscriptions","organizations_url":"https://api.github.com/users/pquerna/orgs","repos_url":"https://api.github.com/users/pquerna/repos","events_url":"https://api.github.com/users/pquerna/events{/privacy}","received_events_url":"https://api.github.com/users/pquerna/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pquerna/ffjson","description":"faster JSON serialization for Go","fork":false,"url":"https://api.github.com/repos/pquerna/ffjson","forks_url":"https://api.github.com/repos/pquerna/ffjson/forks","keys_url":"https://api.github.com/repos/pquerna/ffjson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pquerna/ffjson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pquerna/ffjson/teams","hooks_url":"https://api.github.com/repos/pquerna/ffjson/hooks","issue_events_url":"https://api.github.com/repos/pquerna/ffjson/issues/events{/number}","events_url":"https://api.github.com/repos/pquerna/ffjson/events","assignees_url":"https://api.github.com/repos/pquerna/ffjson/assignees{/user}","branches_url":"https://api.github.com/repos/pquerna/ffjson/branches{/branch}","tags_url":"https://api.github.com/repos/pquerna/ffjson/tags","blobs_url":"https://api.github.com/repos/pquerna/ffjson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pquerna/ffjson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pquerna/ffjson/git/refs{/sha}","trees_url":"https://api.github.com/repos/pquerna/ffjson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pquerna/ffjson/statuses/{sha}","languages_url":"https://api.github.com/repos/pquerna/ffjson/languages","stargazers_url":"https://api.github.com/repos/pquerna/ffjson/stargazers","contributors_url":"https://api.github.com/repos/pquerna/ffjson/contributors","subscribers_url":"https://api.github.com/repos/pquerna/ffjson/subscribers","subscription_url":"https://api.github.com/repos/pquerna/ffjson/subscription","commits_url":"https://api.github.com/repos/pquerna/ffjson/commits{/sha}","git_commits_url":"https://api.github.com/repos/pquerna/ffjson/git/commits{/sha}","comments_url":"https://api.github.com/repos/pquerna/ffjson/comments{/number}","issue_comment_url":"https://api.github.com/repos/pquerna/ffjson/issues/comments/{number}","contents_url":"https://api.github.com/repos/pquerna/ffjson/contents/{+path}","compare_url":"https://api.github.com/repos/pquerna/ffjson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pquerna/ffjson/merges","archive_url":"https://api.github.com/repos/pquerna/ffjson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pquerna/ffjson/downloads","issues_url":"https://api.github.com/repos/pquerna/ffjson/issues{/number}","pulls_url":"https://api.github.com/repos/pquerna/ffjson/pulls{/number}","milestones_url":"https://api.github.com/repos/pquerna/ffjson/milestones{/number}","notifications_url":"https://api.github.com/repos/pquerna/ffjson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pquerna/ffjson/labels{/name}","releases_url":"https://api.github.com/repos/pquerna/ffjson/releases{/id}","created_at":"2014-03-20T14:08:58Z","updated_at":"2015-02-14T09:30:27Z","pushed_at":"2015-02-13T15:39:16Z","git_url":"git://github.com/pquerna/ffjson.git","ssh_url":"git@github.com:pquerna/ffjson.git","clone_url":"https://github.com/pquerna/ffjson.git","svn_url":"https://github.com/pquerna/ffjson","homepage":"","size":1532,"stargazers_count":465,"watchers_count":465,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":9,"forks":25,"open_issues":9,"watchers":465,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pquerna/ffjson/pulls/93"},"html":{"href":"https://github.com/pquerna/ffjson/pull/93"},"issue":{"href":"https://api.github.com/repos/pquerna/ffjson/issues/93"},"comments":{"href":"https://api.github.com/repos/pquerna/ffjson/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/pquerna/ffjson/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/pquerna/ffjson/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/pquerna/ffjson/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/pquerna/ffjson/statuses/4749af564dcfdb94e9e2b9332343b2621bda74fd"}}}}