{"action":"closed","number":1242,"pull_request":{"url":"https://api.github.com/repos/jinzhu/gorm/pulls/1242","id":90851728,"html_url":"https://github.com/jinzhu/gorm/pull/1242","diff_url":"https://github.com/jinzhu/gorm/pull/1242.diff","patch_url":"https://github.com/jinzhu/gorm/pull/1242.patch","issue_url":"https://api.github.com/repos/jinzhu/gorm/issues/1242","number":1242,"state":"closed","locked":false,"title":"Make gorm.Errors available for use outside gorm","user":{"login":"calebthompson","id":711717,"avatar_url":"https://avatars.githubusercontent.com/u/711717?v=3","gravatar_id":"","url":"https://api.github.com/users/calebthompson","html_url":"https://github.com/calebthompson","followers_url":"https://api.github.com/users/calebthompson/followers","following_url":"https://api.github.com/users/calebthompson/following{/other_user}","gists_url":"https://api.github.com/users/calebthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/calebthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebthompson/subscriptions","organizations_url":"https://api.github.com/users/calebthompson/orgs","repos_url":"https://api.github.com/users/calebthompson/repos","events_url":"https://api.github.com/users/calebthompson/events{/privacy}","received_events_url":"https://api.github.com/users/calebthompson/received_events","type":"User","site_admin":false},"body":"gorm.Errors, which usefully implements `error` for an `[]error` as returned by\n`DB.GetError()` was already exported, but because it used a private field\n`errors`, it was not able to be created due to the compile-time error:\n\n```\nimplicit assignment of unexported field 'errors' in gorm.Errors literal\n```\n\nThe trivial solution would be to export the `errors` field on\n`gorm.Errors`, but this led to the issue that the common pattern of checking\n`err != nil` failed because a struct{error: nil} != nil.\n\nWe can take advantage of type aliasing here to make Errors an []error, which\ncan in fact be nil and would pass `err != nil` on the happy path.\n- Remove `(Errors) GetErrors()`, as it's less useful when Errors is an\n  []error which can be iterated over. While this is technically a\n  breaking change, we never expose an Errors and its difficult to build\n  one (it can be done with the existing `(Errors) Add(error)`), but\n  awkwardly. This removal can be reverted without issue and we can make\n  it an identity method, but it seemed an opportune time to reduce API\n  surface area on something that likely isn't used.\n- Remove errorsInterface, as it's not useful without `(Errors)\n  GetErrors()`\n- Change `(*Errors) Add(error)` => `(Errors) Add(error...) Errors`\n  because we can't modify even a *Errors when it's a type alias. This is\n  more idiomatic as it follows the pattern of `slice = append(slice,\n  element)` Go developers are familiar with.\n","created_at":"2016-10-25T17:14:40Z","updated_at":"2016-11-03T13:47:49Z","closed_at":"2016-11-03T13:47:49Z","merged_at":"2016-11-03T13:47:49Z","merge_commit_sha":"d5d3e3a67b25ebfc763bf35572381715d283d84e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jinzhu/gorm/pulls/1242/commits","review_comments_url":"https://api.github.com/repos/jinzhu/gorm/pulls/1242/comments","review_comment_url":"https://api.github.com/repos/jinzhu/gorm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/1242/comments","statuses_url":"https://api.github.com/repos/jinzhu/gorm/statuses/c063624c91912c7c150dd4d9d1fe6a667c573819","head":{"label":"calebthompson:make-errors-public","ref":"make-errors-public","sha":"c063624c91912c7c150dd4d9d1fe6a667c573819","user":{"login":"calebthompson","id":711717,"avatar_url":"https://avatars.githubusercontent.com/u/711717?v=3","gravatar_id":"","url":"https://api.github.com/users/calebthompson","html_url":"https://github.com/calebthompson","followers_url":"https://api.github.com/users/calebthompson/followers","following_url":"https://api.github.com/users/calebthompson/following{/other_user}","gists_url":"https://api.github.com/users/calebthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/calebthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebthompson/subscriptions","organizations_url":"https://api.github.com/users/calebthompson/orgs","repos_url":"https://api.github.com/users/calebthompson/repos","events_url":"https://api.github.com/users/calebthompson/events{/privacy}","received_events_url":"https://api.github.com/users/calebthompson/received_events","type":"User","site_admin":false},"repo":{"id":71915454,"name":"gorm","full_name":"calebthompson/gorm","owner":{"login":"calebthompson","id":711717,"avatar_url":"https://avatars.githubusercontent.com/u/711717?v=3","gravatar_id":"","url":"https://api.github.com/users/calebthompson","html_url":"https://github.com/calebthompson","followers_url":"https://api.github.com/users/calebthompson/followers","following_url":"https://api.github.com/users/calebthompson/following{/other_user}","gists_url":"https://api.github.com/users/calebthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/calebthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebthompson/subscriptions","organizations_url":"https://api.github.com/users/calebthompson/orgs","repos_url":"https://api.github.com/users/calebthompson/repos","events_url":"https://api.github.com/users/calebthompson/events{/privacy}","received_events_url":"https://api.github.com/users/calebthompson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calebthompson/gorm","description":"The fantastic ORM library for Golang, aims to be developer friendly","fork":true,"url":"https://api.github.com/repos/calebthompson/gorm","forks_url":"https://api.github.com/repos/calebthompson/gorm/forks","keys_url":"https://api.github.com/repos/calebthompson/gorm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calebthompson/gorm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calebthompson/gorm/teams","hooks_url":"https://api.github.com/repos/calebthompson/gorm/hooks","issue_events_url":"https://api.github.com/repos/calebthompson/gorm/issues/events{/number}","events_url":"https://api.github.com/repos/calebthompson/gorm/events","assignees_url":"https://api.github.com/repos/calebthompson/gorm/assignees{/user}","branches_url":"https://api.github.com/repos/calebthompson/gorm/branches{/branch}","tags_url":"https://api.github.com/repos/calebthompson/gorm/tags","blobs_url":"https://api.github.com/repos/calebthompson/gorm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calebthompson/gorm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calebthompson/gorm/git/refs{/sha}","trees_url":"https://api.github.com/repos/calebthompson/gorm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calebthompson/gorm/statuses/{sha}","languages_url":"https://api.github.com/repos/calebthompson/gorm/languages","stargazers_url":"https://api.github.com/repos/calebthompson/gorm/stargazers","contributors_url":"https://api.github.com/repos/calebthompson/gorm/contributors","subscribers_url":"https://api.github.com/repos/calebthompson/gorm/subscribers","subscription_url":"https://api.github.com/repos/calebthompson/gorm/subscription","commits_url":"https://api.github.com/repos/calebthompson/gorm/commits{/sha}","git_commits_url":"https://api.github.com/repos/calebthompson/gorm/git/commits{/sha}","comments_url":"https://api.github.com/repos/calebthompson/gorm/comments{/number}","issue_comment_url":"https://api.github.com/repos/calebthompson/gorm/issues/comments{/number}","contents_url":"https://api.github.com/repos/calebthompson/gorm/contents/{+path}","compare_url":"https://api.github.com/repos/calebthompson/gorm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calebthompson/gorm/merges","archive_url":"https://api.github.com/repos/calebthompson/gorm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calebthompson/gorm/downloads","issues_url":"https://api.github.com/repos/calebthompson/gorm/issues{/number}","pulls_url":"https://api.github.com/repos/calebthompson/gorm/pulls{/number}","milestones_url":"https://api.github.com/repos/calebthompson/gorm/milestones{/number}","notifications_url":"https://api.github.com/repos/calebthompson/gorm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calebthompson/gorm/labels{/name}","releases_url":"https://api.github.com/repos/calebthompson/gorm/releases{/id}","deployments_url":"https://api.github.com/repos/calebthompson/gorm/deployments","created_at":"2016-10-25T16:12:58Z","updated_at":"2016-10-25T16:13:00Z","pushed_at":"2016-10-25T17:14:26Z","git_url":"git://github.com/calebthompson/gorm.git","ssh_url":"git@github.com:calebthompson/gorm.git","clone_url":"https://github.com/calebthompson/gorm.git","svn_url":"https://github.com/calebthompson/gorm","homepage":"http://jinzhu.github.io/gorm","size":3253,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"jinzhu:master","ref":"master","sha":"c1b9cf186e4bcd8e5d566ef43f2ae2dfe22dc34e","user":{"login":"jinzhu","id":6843,"avatar_url":"https://avatars.githubusercontent.com/u/6843?v=3","gravatar_id":"","url":"https://api.github.com/users/jinzhu","html_url":"https://github.com/jinzhu","followers_url":"https://api.github.com/users/jinzhu/followers","following_url":"https://api.github.com/users/jinzhu/following{/other_user}","gists_url":"https://api.github.com/users/jinzhu/gists{/gist_id}","starred_url":"https://api.github.com/users/jinzhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinzhu/subscriptions","organizations_url":"https://api.github.com/users/jinzhu/orgs","repos_url":"https://api.github.com/users/jinzhu/repos","events_url":"https://api.github.com/users/jinzhu/events{/privacy}","received_events_url":"https://api.github.com/users/jinzhu/received_events","type":"User","site_admin":false},"repo":{"id":13855476,"name":"gorm","full_name":"jinzhu/gorm","owner":{"login":"jinzhu","id":6843,"avatar_url":"https://avatars.githubusercontent.com/u/6843?v=3","gravatar_id":"","url":"https://api.github.com/users/jinzhu","html_url":"https://github.com/jinzhu","followers_url":"https://api.github.com/users/jinzhu/followers","following_url":"https://api.github.com/users/jinzhu/following{/other_user}","gists_url":"https://api.github.com/users/jinzhu/gists{/gist_id}","starred_url":"https://api.github.com/users/jinzhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinzhu/subscriptions","organizations_url":"https://api.github.com/users/jinzhu/orgs","repos_url":"https://api.github.com/users/jinzhu/repos","events_url":"https://api.github.com/users/jinzhu/events{/privacy}","received_events_url":"https://api.github.com/users/jinzhu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jinzhu/gorm","description":"The fantastic ORM library for Golang, aims to be developer friendly","fork":false,"url":"https://api.github.com/repos/jinzhu/gorm","forks_url":"https://api.github.com/repos/jinzhu/gorm/forks","keys_url":"https://api.github.com/repos/jinzhu/gorm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jinzhu/gorm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jinzhu/gorm/teams","hooks_url":"https://api.github.com/repos/jinzhu/gorm/hooks","issue_events_url":"https://api.github.com/repos/jinzhu/gorm/issues/events{/number}","events_url":"https://api.github.com/repos/jinzhu/gorm/events","assignees_url":"https://api.github.com/repos/jinzhu/gorm/assignees{/user}","branches_url":"https://api.github.com/repos/jinzhu/gorm/branches{/branch}","tags_url":"https://api.github.com/repos/jinzhu/gorm/tags","blobs_url":"https://api.github.com/repos/jinzhu/gorm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jinzhu/gorm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jinzhu/gorm/git/refs{/sha}","trees_url":"https://api.github.com/repos/jinzhu/gorm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jinzhu/gorm/statuses/{sha}","languages_url":"https://api.github.com/repos/jinzhu/gorm/languages","stargazers_url":"https://api.github.com/repos/jinzhu/gorm/stargazers","contributors_url":"https://api.github.com/repos/jinzhu/gorm/contributors","subscribers_url":"https://api.github.com/repos/jinzhu/gorm/subscribers","subscription_url":"https://api.github.com/repos/jinzhu/gorm/subscription","commits_url":"https://api.github.com/repos/jinzhu/gorm/commits{/sha}","git_commits_url":"https://api.github.com/repos/jinzhu/gorm/git/commits{/sha}","comments_url":"https://api.github.com/repos/jinzhu/gorm/comments{/number}","issue_comment_url":"https://api.github.com/repos/jinzhu/gorm/issues/comments{/number}","contents_url":"https://api.github.com/repos/jinzhu/gorm/contents/{+path}","compare_url":"https://api.github.com/repos/jinzhu/gorm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jinzhu/gorm/merges","archive_url":"https://api.github.com/repos/jinzhu/gorm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jinzhu/gorm/downloads","issues_url":"https://api.github.com/repos/jinzhu/gorm/issues{/number}","pulls_url":"https://api.github.com/repos/jinzhu/gorm/pulls{/number}","milestones_url":"https://api.github.com/repos/jinzhu/gorm/milestones{/number}","notifications_url":"https://api.github.com/repos/jinzhu/gorm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jinzhu/gorm/labels{/name}","releases_url":"https://api.github.com/repos/jinzhu/gorm/releases{/id}","deployments_url":"https://api.github.com/repos/jinzhu/gorm/deployments","created_at":"2013-10-25T08:31:38Z","updated_at":"2016-11-03T06:38:06Z","pushed_at":"2016-11-03T13:47:49Z","git_url":"git://github.com/jinzhu/gorm.git","ssh_url":"git@github.com:jinzhu/gorm.git","clone_url":"https://github.com/jinzhu/gorm.git","svn_url":"https://github.com/jinzhu/gorm","homepage":"http://jinzhu.github.io/gorm","size":4019,"stargazers_count":4537,"watchers_count":4537,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":538,"mirror_url":null,"open_issues_count":130,"forks":538,"open_issues":130,"watchers":4537,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jinzhu/gorm/pulls/1242"},"html":{"href":"https://github.com/jinzhu/gorm/pull/1242"},"issue":{"href":"https://api.github.com/repos/jinzhu/gorm/issues/1242"},"comments":{"href":"https://api.github.com/repos/jinzhu/gorm/issues/1242/comments"},"review_comments":{"href":"https://api.github.com/repos/jinzhu/gorm/pulls/1242/comments"},"review_comment":{"href":"https://api.github.com/repos/jinzhu/gorm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jinzhu/gorm/pulls/1242/commits"},"statuses":{"href":"https://api.github.com/repos/jinzhu/gorm/statuses/c063624c91912c7c150dd4d9d1fe6a667c573819"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"jinzhu","id":6843,"avatar_url":"https://avatars.githubusercontent.com/u/6843?v=3","gravatar_id":"","url":"https://api.github.com/users/jinzhu","html_url":"https://github.com/jinzhu","followers_url":"https://api.github.com/users/jinzhu/followers","following_url":"https://api.github.com/users/jinzhu/following{/other_user}","gists_url":"https://api.github.com/users/jinzhu/gists{/gist_id}","starred_url":"https://api.github.com/users/jinzhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinzhu/subscriptions","organizations_url":"https://api.github.com/users/jinzhu/orgs","repos_url":"https://api.github.com/users/jinzhu/repos","events_url":"https://api.github.com/users/jinzhu/events{/privacy}","received_events_url":"https://api.github.com/users/jinzhu/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":43,"deletions":25,"changed_files":3}}
{"actor":{"display_login":"jinzhu"}}