{"action":"created","comment":{"url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/comments/55554218","id":55554218,"diff_hunk":"@@ -0,0 +1,267 @@\n+package dynamodbattribute\n+\n+import (\n+\t\"reflect\"\n+\t\"sort\"\n+\t\"strings\"\n+)\n+\n+type field struct {\n+\ttag\n+\n+\tName        string\n+\tNameFromTag bool\n+\n+\tIndex []int\n+\tType  reflect.Type\n+}\n+\n+func fieldByName(fields []field, name string) (field, bool) {\n+\tfor _, f := range fields {","path":"service/dynamodb/dynamodbattribute/field.go","position":20,"original_position":20,"commit_id":"19ae435773779e54436eb26ffed0b44980954616","original_commit_id":"19ae435773779e54436eb26ffed0b44980954616","user":{"login":"xibz","id":1964445,"avatar_url":"https://avatars.githubusercontent.com/u/1964445?v=3","gravatar_id":"","url":"https://api.github.com/users/xibz","html_url":"https://github.com/xibz","followers_url":"https://api.github.com/users/xibz/followers","following_url":"https://api.github.com/users/xibz/following{/other_user}","gists_url":"https://api.github.com/users/xibz/gists{/gist_id}","starred_url":"https://api.github.com/users/xibz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xibz/subscriptions","organizations_url":"https://api.github.com/users/xibz/orgs","repos_url":"https://api.github.com/users/xibz/repos","events_url":"https://api.github.com/users/xibz/events{/privacy}","received_events_url":"https://api.github.com/users/xibz/received_events","type":"User","site_admin":false},"body":"What I was thinking was\r\n```go\r\nfunc fieldByName(fields []field, name string) (field, bool) {\r\n    foldExists := false\r\n    foldField := field{}\r\n    \r\n\tfor _, f := range fields {\r\n\t\tif f.Name == name {\r\n\t\t\treturn f, true\r\n\t\t}\r\n\t\tif !foldExists && strings.EqualFold(f.Name, name) {\r\n            foldField = f\r\n            foldExists = true\r\n\t\t}\r\n\t}\r\n\r\n\treturn foldField, foldExists\r\n}\r\n```","created_at":"2016-03-09T17:20:51Z","updated_at":"2016-03-09T17:20:51Z","html_url":"https://github.com/aws/aws-sdk-go/pull/580#discussion_r55554218","pull_request_url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580","_links":{"self":{"href":"https://api.github.com/repos/aws/aws-sdk-go/pulls/comments/55554218"},"html":{"href":"https://github.com/aws/aws-sdk-go/pull/580#discussion_r55554218"},"pull_request":{"href":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580"}}},"pull_request":{"url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580","id":61999695,"html_url":"https://github.com/aws/aws-sdk-go/pull/580","diff_url":"https://github.com/aws/aws-sdk-go/pull/580.diff","patch_url":"https://github.com/aws/aws-sdk-go/pull/580.patch","issue_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/580","number":580,"state":"open","locked":false,"title":"Add complete support for DynamoDB AttributeValue marshaler","user":{"login":"jasdel","id":961963,"avatar_url":"https://avatars.githubusercontent.com/u/961963?v=3","gravatar_id":"","url":"https://api.github.com/users/jasdel","html_url":"https://github.com/jasdel","followers_url":"https://api.github.com/users/jasdel/followers","following_url":"https://api.github.com/users/jasdel/following{/other_user}","gists_url":"https://api.github.com/users/jasdel/gists{/gist_id}","starred_url":"https://api.github.com/users/jasdel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasdel/subscriptions","organizations_url":"https://api.github.com/users/jasdel/orgs","repos_url":"https://api.github.com/users/jasdel/repos","events_url":"https://api.github.com/users/jasdel/events{/privacy}","received_events_url":"https://api.github.com/users/jasdel/received_events","type":"User","site_admin":false},"body":"This change deprecates the `ConvertTo` and `ConvertFrom` functions. In there\r\nplace a Marshal and Unmarshal functions were added. The new functions\r\nalso include Map and List aliases similar to the Convert functions for\r\nconvenience.\r\n\r\nThe new `Marshal` and `Unmarshal` fully support DynamoDB AttributeValue types,\r\nwithout relying on `encoding/json` for converting typed values to `map[string]interface{}`.\r\nThis has the added benefit of being able to (un)marshal Binary, Number, and String\r\nsets.\r\n\r\nThis change does not modify the existing Convert functions. Just deprecating them. It\r\nbecame too complex to update the Convert functions while maintaining backward's\r\ncapability with all of the possible reliance on `encoding/json`.\r\n\r\nFix #529\r\n\r\nAlso fixes a bug in `awsutil.Prettify ` paniciting on invalid values.\r\n\r\nTODO:\r\n- [ ] Document for `Marshal` and `Unmarshal`\r\n- [ ] Document `dynamodbav` and `json` struct tag usage\r\n- [ ] Document `Marshaler` and `Unmarshaler` interfaces, with example\r\n- [x] Fix travis unmarshal [panic](https://travis-ci.org/aws/aws-sdk-go/jobs/114390276#L2817), \r\n- [ ] Better Overflow errors","created_at":"2016-03-07T23:29:02Z","updated_at":"2016-03-09T17:20:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8f61cfac6ab71d2f91129f8e9988dcacae020dc","assignee":{"login":"xibz","id":1964445,"avatar_url":"https://avatars.githubusercontent.com/u/1964445?v=3","gravatar_id":"","url":"https://api.github.com/users/xibz","html_url":"https://github.com/xibz","followers_url":"https://api.github.com/users/xibz/followers","following_url":"https://api.github.com/users/xibz/following{/other_user}","gists_url":"https://api.github.com/users/xibz/gists{/gist_id}","starred_url":"https://api.github.com/users/xibz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xibz/subscriptions","organizations_url":"https://api.github.com/users/xibz/orgs","repos_url":"https://api.github.com/users/xibz/repos","events_url":"https://api.github.com/users/xibz/events{/privacy}","received_events_url":"https://api.github.com/users/xibz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580/commits","review_comments_url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580/comments","review_comment_url":"https://api.github.com/repos/aws/aws-sdk-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/580/comments","statuses_url":"https://api.github.com/repos/aws/aws-sdk-go/statuses/19ae435773779e54436eb26ffed0b44980954616","head":{"label":"aws:fixIssue529DynamoDbConvert","ref":"fixIssue529DynamoDbConvert","sha":"19ae435773779e54436eb26ffed0b44980954616","user":{"login":"aws","id":2232217,"avatar_url":"https://avatars.githubusercontent.com/u/2232217?v=3","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":27576132,"name":"aws-sdk-go","full_name":"aws/aws-sdk-go","owner":{"login":"aws","id":2232217,"avatar_url":"https://avatars.githubusercontent.com/u/2232217?v=3","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/aws-sdk-go","description":"AWS SDK for the Go programming language.","fork":false,"url":"https://api.github.com/repos/aws/aws-sdk-go","forks_url":"https://api.github.com/repos/aws/aws-sdk-go/forks","keys_url":"https://api.github.com/repos/aws/aws-sdk-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/aws-sdk-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/aws-sdk-go/teams","hooks_url":"https://api.github.com/repos/aws/aws-sdk-go/hooks","issue_events_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/events{/number}","events_url":"https://api.github.com/repos/aws/aws-sdk-go/events","assignees_url":"https://api.github.com/repos/aws/aws-sdk-go/assignees{/user}","branches_url":"https://api.github.com/repos/aws/aws-sdk-go/branches{/branch}","tags_url":"https://api.github.com/repos/aws/aws-sdk-go/tags","blobs_url":"https://api.github.com/repos/aws/aws-sdk-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/aws-sdk-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/aws-sdk-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/aws-sdk-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/aws-sdk-go/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/aws-sdk-go/languages","stargazers_url":"https://api.github.com/repos/aws/aws-sdk-go/stargazers","contributors_url":"https://api.github.com/repos/aws/aws-sdk-go/contributors","subscribers_url":"https://api.github.com/repos/aws/aws-sdk-go/subscribers","subscription_url":"https://api.github.com/repos/aws/aws-sdk-go/subscription","commits_url":"https://api.github.com/repos/aws/aws-sdk-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/aws-sdk-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/aws-sdk-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/aws-sdk-go/contents/{+path}","compare_url":"https://api.github.com/repos/aws/aws-sdk-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/aws-sdk-go/merges","archive_url":"https://api.github.com/repos/aws/aws-sdk-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/aws-sdk-go/downloads","issues_url":"https://api.github.com/repos/aws/aws-sdk-go/issues{/number}","pulls_url":"https://api.github.com/repos/aws/aws-sdk-go/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/aws-sdk-go/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/aws-sdk-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/aws-sdk-go/labels{/name}","releases_url":"https://api.github.com/repos/aws/aws-sdk-go/releases{/id}","deployments_url":"https://api.github.com/repos/aws/aws-sdk-go/deployments","created_at":"2014-12-05T05:29:41Z","updated_at":"2016-03-08T18:08:53Z","pushed_at":"2016-03-08T23:11:21Z","git_url":"git://github.com/aws/aws-sdk-go.git","ssh_url":"git@github.com:aws/aws-sdk-go.git","clone_url":"https://github.com/aws/aws-sdk-go.git","svn_url":"https://github.com/aws/aws-sdk-go","homepage":"http://aws.amazon.com/sdk-for-go/","size":22028,"stargazers_count":2367,"watchers_count":2367,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":355,"mirror_url":null,"open_issues_count":45,"forks":355,"open_issues":45,"watchers":2367,"default_branch":"master"}},"base":{"label":"aws:master","ref":"master","sha":"6b5f7cd0bac07e029ea9b05fa8e701ed75759288","user":{"login":"aws","id":2232217,"avatar_url":"https://avatars.githubusercontent.com/u/2232217?v=3","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":27576132,"name":"aws-sdk-go","full_name":"aws/aws-sdk-go","owner":{"login":"aws","id":2232217,"avatar_url":"https://avatars.githubusercontent.com/u/2232217?v=3","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/aws-sdk-go","description":"AWS SDK for the Go programming language.","fork":false,"url":"https://api.github.com/repos/aws/aws-sdk-go","forks_url":"https://api.github.com/repos/aws/aws-sdk-go/forks","keys_url":"https://api.github.com/repos/aws/aws-sdk-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/aws-sdk-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/aws-sdk-go/teams","hooks_url":"https://api.github.com/repos/aws/aws-sdk-go/hooks","issue_events_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/events{/number}","events_url":"https://api.github.com/repos/aws/aws-sdk-go/events","assignees_url":"https://api.github.com/repos/aws/aws-sdk-go/assignees{/user}","branches_url":"https://api.github.com/repos/aws/aws-sdk-go/branches{/branch}","tags_url":"https://api.github.com/repos/aws/aws-sdk-go/tags","blobs_url":"https://api.github.com/repos/aws/aws-sdk-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/aws-sdk-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/aws-sdk-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/aws-sdk-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/aws-sdk-go/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/aws-sdk-go/languages","stargazers_url":"https://api.github.com/repos/aws/aws-sdk-go/stargazers","contributors_url":"https://api.github.com/repos/aws/aws-sdk-go/contributors","subscribers_url":"https://api.github.com/repos/aws/aws-sdk-go/subscribers","subscription_url":"https://api.github.com/repos/aws/aws-sdk-go/subscription","commits_url":"https://api.github.com/repos/aws/aws-sdk-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/aws-sdk-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/aws-sdk-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/aws-sdk-go/contents/{+path}","compare_url":"https://api.github.com/repos/aws/aws-sdk-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/aws-sdk-go/merges","archive_url":"https://api.github.com/repos/aws/aws-sdk-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/aws-sdk-go/downloads","issues_url":"https://api.github.com/repos/aws/aws-sdk-go/issues{/number}","pulls_url":"https://api.github.com/repos/aws/aws-sdk-go/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/aws-sdk-go/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/aws-sdk-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/aws-sdk-go/labels{/name}","releases_url":"https://api.github.com/repos/aws/aws-sdk-go/releases{/id}","deployments_url":"https://api.github.com/repos/aws/aws-sdk-go/deployments","created_at":"2014-12-05T05:29:41Z","updated_at":"2016-03-08T18:08:53Z","pushed_at":"2016-03-08T23:11:21Z","git_url":"git://github.com/aws/aws-sdk-go.git","ssh_url":"git@github.com:aws/aws-sdk-go.git","clone_url":"https://github.com/aws/aws-sdk-go.git","svn_url":"https://github.com/aws/aws-sdk-go","homepage":"http://aws.amazon.com/sdk-for-go/","size":22028,"stargazers_count":2367,"watchers_count":2367,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":355,"mirror_url":null,"open_issues_count":45,"forks":355,"open_issues":45,"watchers":2367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580"},"html":{"href":"https://github.com/aws/aws-sdk-go/pull/580"},"issue":{"href":"https://api.github.com/repos/aws/aws-sdk-go/issues/580"},"comments":{"href":"https://api.github.com/repos/aws/aws-sdk-go/issues/580/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/aws-sdk-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/aws-sdk-go/pulls/580/commits"},"statuses":{"href":"https://api.github.com/repos/aws/aws-sdk-go/statuses/19ae435773779e54436eb26ffed0b44980954616"}}}}