{"action":"created","comment":{"url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/comments/73748300","id":73748300,"diff_hunk":"@@ -510,6 +510,23 @@ func (err VirError) Error() string {\n \t\terr.Code, err.Domain, err.Message)\n }\n \n+var ErrNoError = VirError{\n+\tCode:    VIR_ERR_OK,\n+\tDomain:  VIR_FROM_NONE,\n+\tMessage: \"\",\n+\tLevel:   VIR_ERR_NONE,\n+}\n+\n+func GetLastError() VirError {\n+\terr := C.virGetLastError()\n+\tif err == nil {\n+\t\treturn ErrNoError","path":"error.go","position":14,"original_position":14,"commit_id":"08d73910769a620790a7a678d5d229d476b0e8b8","original_commit_id":"08d73910769a620790a7a678d5d229d476b0e8b8","user":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"body":"Smart.","created_at":"2016-08-05T19:37:14Z","updated_at":"2016-08-05T19:37:15Z","html_url":"https://github.com/rgbkrk/libvirt-go/pull/103#discussion_r73748300","pull_request_url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/comments/73748300"},"html":{"href":"https://github.com/rgbkrk/libvirt-go/pull/103#discussion_r73748300"},"pull_request":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103","id":79558693,"html_url":"https://github.com/rgbkrk/libvirt-go/pull/103","diff_url":"https://github.com/rgbkrk/libvirt-go/pull/103.diff","patch_url":"https://github.com/rgbkrk/libvirt-go/pull/103.patch","issue_url":"https://api.github.com/repos/rgbkrk/libvirt-go/issues/103","number":103,"state":"open","locked":false,"title":"errors: don't make GetLastError() segfault when on no error condition","user":{"login":"vincentbernat","id":631446,"avatar_url":"https://avatars.githubusercontent.com/u/631446?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentbernat","html_url":"https://github.com/vincentbernat","followers_url":"https://api.github.com/users/vincentbernat/followers","following_url":"https://api.github.com/users/vincentbernat/following{/other_user}","gists_url":"https://api.github.com/users/vincentbernat/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentbernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentbernat/subscriptions","organizations_url":"https://api.github.com/users/vincentbernat/orgs","repos_url":"https://api.github.com/users/vincentbernat/repos","events_url":"https://api.github.com/users/vincentbernat/events{/privacy}","received_events_url":"https://api.github.com/users/vincentbernat/received_events","type":"User","site_admin":false},"body":"When calling `GetLastError()` twice in a row, we get a segfault because\r\n`virGetLastError()` C function returns nil. We cannot return nil since\r\nwe don't return a pointer, but we can return a special error that means\r\n\"no error\".","created_at":"2016-08-01T12:15:57Z","updated_at":"2016-08-05T19:37:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc4aef733513291bf0b33e21de8fcbd78123e90f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103/commits","review_comments_url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103/comments","review_comment_url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rgbkrk/libvirt-go/issues/103/comments","statuses_url":"https://api.github.com/repos/rgbkrk/libvirt-go/statuses/08d73910769a620790a7a678d5d229d476b0e8b8","head":{"label":"exoscale:fix/get-last-error","ref":"fix/get-last-error","sha":"08d73910769a620790a7a678d5d229d476b0e8b8","user":{"login":"exoscale","id":2023286,"avatar_url":"https://avatars.githubusercontent.com/u/2023286?v=3","gravatar_id":"","url":"https://api.github.com/users/exoscale","html_url":"https://github.com/exoscale","followers_url":"https://api.github.com/users/exoscale/followers","following_url":"https://api.github.com/users/exoscale/following{/other_user}","gists_url":"https://api.github.com/users/exoscale/gists{/gist_id}","starred_url":"https://api.github.com/users/exoscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exoscale/subscriptions","organizations_url":"https://api.github.com/users/exoscale/orgs","repos_url":"https://api.github.com/users/exoscale/repos","events_url":"https://api.github.com/users/exoscale/events{/privacy}","received_events_url":"https://api.github.com/users/exoscale/received_events","type":"Organization","site_admin":false},"repo":{"id":63958317,"name":"libvirt-go","full_name":"exoscale/libvirt-go","owner":{"login":"exoscale","id":2023286,"avatar_url":"https://avatars.githubusercontent.com/u/2023286?v=3","gravatar_id":"","url":"https://api.github.com/users/exoscale","html_url":"https://github.com/exoscale","followers_url":"https://api.github.com/users/exoscale/followers","following_url":"https://api.github.com/users/exoscale/following{/other_user}","gists_url":"https://api.github.com/users/exoscale/gists{/gist_id}","starred_url":"https://api.github.com/users/exoscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exoscale/subscriptions","organizations_url":"https://api.github.com/users/exoscale/orgs","repos_url":"https://api.github.com/users/exoscale/repos","events_url":"https://api.github.com/users/exoscale/events{/privacy}","received_events_url":"https://api.github.com/users/exoscale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exoscale/libvirt-go","description":"Go bindings for libvirt","fork":true,"url":"https://api.github.com/repos/exoscale/libvirt-go","forks_url":"https://api.github.com/repos/exoscale/libvirt-go/forks","keys_url":"https://api.github.com/repos/exoscale/libvirt-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exoscale/libvirt-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exoscale/libvirt-go/teams","hooks_url":"https://api.github.com/repos/exoscale/libvirt-go/hooks","issue_events_url":"https://api.github.com/repos/exoscale/libvirt-go/issues/events{/number}","events_url":"https://api.github.com/repos/exoscale/libvirt-go/events","assignees_url":"https://api.github.com/repos/exoscale/libvirt-go/assignees{/user}","branches_url":"https://api.github.com/repos/exoscale/libvirt-go/branches{/branch}","tags_url":"https://api.github.com/repos/exoscale/libvirt-go/tags","blobs_url":"https://api.github.com/repos/exoscale/libvirt-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exoscale/libvirt-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exoscale/libvirt-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/exoscale/libvirt-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exoscale/libvirt-go/statuses/{sha}","languages_url":"https://api.github.com/repos/exoscale/libvirt-go/languages","stargazers_url":"https://api.github.com/repos/exoscale/libvirt-go/stargazers","contributors_url":"https://api.github.com/repos/exoscale/libvirt-go/contributors","subscribers_url":"https://api.github.com/repos/exoscale/libvirt-go/subscribers","subscription_url":"https://api.github.com/repos/exoscale/libvirt-go/subscription","commits_url":"https://api.github.com/repos/exoscale/libvirt-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/exoscale/libvirt-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/exoscale/libvirt-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/exoscale/libvirt-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/exoscale/libvirt-go/contents/{+path}","compare_url":"https://api.github.com/repos/exoscale/libvirt-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exoscale/libvirt-go/merges","archive_url":"https://api.github.com/repos/exoscale/libvirt-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exoscale/libvirt-go/downloads","issues_url":"https://api.github.com/repos/exoscale/libvirt-go/issues{/number}","pulls_url":"https://api.github.com/repos/exoscale/libvirt-go/pulls{/number}","milestones_url":"https://api.github.com/repos/exoscale/libvirt-go/milestones{/number}","notifications_url":"https://api.github.com/repos/exoscale/libvirt-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exoscale/libvirt-go/labels{/name}","releases_url":"https://api.github.com/repos/exoscale/libvirt-go/releases{/id}","deployments_url":"https://api.github.com/repos/exoscale/libvirt-go/deployments","created_at":"2016-07-22T14:10:12Z","updated_at":"2016-07-22T14:10:13Z","pushed_at":"2016-08-01T12:15:50Z","git_url":"git://github.com/exoscale/libvirt-go.git","ssh_url":"git@github.com:exoscale/libvirt-go.git","clone_url":"https://github.com/exoscale/libvirt-go.git","svn_url":"https://github.com/exoscale/libvirt-go","homepage":null,"size":301,"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":"exoscale/master"}},"base":{"label":"rgbkrk:master","ref":"master","sha":"4d6bbcf8d32fb35294acdca30a91ddc4bc595b23","user":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"repo":{"id":12176520,"name":"libvirt-go","full_name":"rgbkrk/libvirt-go","owner":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rgbkrk/libvirt-go","description":"Go bindings for libvirt","fork":false,"url":"https://api.github.com/repos/rgbkrk/libvirt-go","forks_url":"https://api.github.com/repos/rgbkrk/libvirt-go/forks","keys_url":"https://api.github.com/repos/rgbkrk/libvirt-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rgbkrk/libvirt-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rgbkrk/libvirt-go/teams","hooks_url":"https://api.github.com/repos/rgbkrk/libvirt-go/hooks","issue_events_url":"https://api.github.com/repos/rgbkrk/libvirt-go/issues/events{/number}","events_url":"https://api.github.com/repos/rgbkrk/libvirt-go/events","assignees_url":"https://api.github.com/repos/rgbkrk/libvirt-go/assignees{/user}","branches_url":"https://api.github.com/repos/rgbkrk/libvirt-go/branches{/branch}","tags_url":"https://api.github.com/repos/rgbkrk/libvirt-go/tags","blobs_url":"https://api.github.com/repos/rgbkrk/libvirt-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rgbkrk/libvirt-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rgbkrk/libvirt-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/rgbkrk/libvirt-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rgbkrk/libvirt-go/statuses/{sha}","languages_url":"https://api.github.com/repos/rgbkrk/libvirt-go/languages","stargazers_url":"https://api.github.com/repos/rgbkrk/libvirt-go/stargazers","contributors_url":"https://api.github.com/repos/rgbkrk/libvirt-go/contributors","subscribers_url":"https://api.github.com/repos/rgbkrk/libvirt-go/subscribers","subscription_url":"https://api.github.com/repos/rgbkrk/libvirt-go/subscription","commits_url":"https://api.github.com/repos/rgbkrk/libvirt-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/rgbkrk/libvirt-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/rgbkrk/libvirt-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/rgbkrk/libvirt-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/rgbkrk/libvirt-go/contents/{+path}","compare_url":"https://api.github.com/repos/rgbkrk/libvirt-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rgbkrk/libvirt-go/merges","archive_url":"https://api.github.com/repos/rgbkrk/libvirt-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rgbkrk/libvirt-go/downloads","issues_url":"https://api.github.com/repos/rgbkrk/libvirt-go/issues{/number}","pulls_url":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls{/number}","milestones_url":"https://api.github.com/repos/rgbkrk/libvirt-go/milestones{/number}","notifications_url":"https://api.github.com/repos/rgbkrk/libvirt-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rgbkrk/libvirt-go/labels{/name}","releases_url":"https://api.github.com/repos/rgbkrk/libvirt-go/releases{/id}","deployments_url":"https://api.github.com/repos/rgbkrk/libvirt-go/deployments","created_at":"2013-08-17T09:23:47Z","updated_at":"2016-08-01T12:59:27Z","pushed_at":"2016-08-05T19:34:41Z","git_url":"git://github.com/rgbkrk/libvirt-go.git","ssh_url":"git@github.com:rgbkrk/libvirt-go.git","clone_url":"https://github.com/rgbkrk/libvirt-go.git","svn_url":"https://github.com/rgbkrk/libvirt-go","homepage":null,"size":319,"stargazers_count":125,"watchers_count":125,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":6,"forks":46,"open_issues":6,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103"},"html":{"href":"https://github.com/rgbkrk/libvirt-go/pull/103"},"issue":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/issues/103"},"comments":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/rgbkrk/libvirt-go/statuses/08d73910769a620790a7a678d5d229d476b0e8b8"}}}}
{"actor":{"display_login":"rgbkrk"}}