{"action":"opened","number":44,"pull_request":{"url":"https://api.github.com/repos/kidoman/embd/pulls/44","id":54698221,"html_url":"https://github.com/kidoman/embd/pull/44","diff_url":"https://github.com/kidoman/embd/pull/44.diff","patch_url":"https://github.com/kidoman/embd/pull/44.patch","issue_url":"https://api.github.com/repos/kidoman/embd/issues/44","number":44,"state":"open","locked":false,"title":"Unexport digital pins on Close().","user":{"login":"wujiang","id":77030,"avatar_url":"https://avatars.githubusercontent.com/u/77030?v=3","gravatar_id":"","url":"https://api.github.com/users/wujiang","html_url":"https://github.com/wujiang","followers_url":"https://api.github.com/users/wujiang/followers","following_url":"https://api.github.com/users/wujiang/following{/other_user}","gists_url":"https://api.github.com/users/wujiang/gists{/gist_id}","starred_url":"https://api.github.com/users/wujiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wujiang/subscriptions","organizations_url":"https://api.github.com/users/wujiang/orgs","repos_url":"https://api.github.com/users/wujiang/repos","events_url":"https://api.github.com/users/wujiang/events{/privacy}","received_events_url":"https://api.github.com/users/wujiang/received_events","type":"User","site_admin":false},"body":"Exported digital pins can be uninitialized.\r\n\r\n#### How to reproduce the problem\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n        \"fmt\"\r\n\r\n        \"github.com/kidoman/embd\"\r\n        _ \"github.com/wujiang/embd/host/rpi\"\r\n)\r\n\r\nfunc main() {\r\n        embd.InitGPIO()\r\n        defer embd.CloseGPIO()\r\n        fmt.Println(embd.SetDirection(12, embd.Out))\r\n}\r\n```\r\n\r\n```sh\r\n/tmp $ go build\r\n/tmp $ ./tmp\r\nopen /sys/class/gpio/gpio12/direction: permission denied\r\n/tmp $ ./tmp\r\nwrite /sys/class/gpio/export: device or resource busy\r\n/tmp $ ./tmp\r\nwrite /sys/class/gpio/export: device or resource busy\r\n/tmp $ ls /sys/class/gpio/\r\nexport  gpio12  gpiochip0  unexport\r\n```\r\n\r\nAfter the change:\r\n\r\n```sh\r\n/tmp $ ./tmp\r\nopen /sys/class/gpio/gpio12/direction: permission denied\r\n/tmp $ ./tmp\r\nopen /sys/class/gpio/gpio12/direction: permission denied\r\n/tmp $ ./tmp\r\nopen /sys/class/gpio/gpio12/direction: permission denied\r\n```","created_at":"2015-12-29T02:27:28Z","updated_at":"2015-12-29T02:27:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kidoman/embd/pulls/44/commits","review_comments_url":"https://api.github.com/repos/kidoman/embd/pulls/44/comments","review_comment_url":"https://api.github.com/repos/kidoman/embd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kidoman/embd/issues/44/comments","statuses_url":"https://api.github.com/repos/kidoman/embd/statuses/ad34e62432ea032b9dc4c4ea8dbab1e6bee9b9c1","head":{"label":"wujiang:wujiang/digital-pin-close","ref":"wujiang/digital-pin-close","sha":"ad34e62432ea032b9dc4c4ea8dbab1e6bee9b9c1","user":{"login":"wujiang","id":77030,"avatar_url":"https://avatars.githubusercontent.com/u/77030?v=3","gravatar_id":"","url":"https://api.github.com/users/wujiang","html_url":"https://github.com/wujiang","followers_url":"https://api.github.com/users/wujiang/followers","following_url":"https://api.github.com/users/wujiang/following{/other_user}","gists_url":"https://api.github.com/users/wujiang/gists{/gist_id}","starred_url":"https://api.github.com/users/wujiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wujiang/subscriptions","organizations_url":"https://api.github.com/users/wujiang/orgs","repos_url":"https://api.github.com/users/wujiang/repos","events_url":"https://api.github.com/users/wujiang/events{/privacy}","received_events_url":"https://api.github.com/users/wujiang/received_events","type":"User","site_admin":false},"repo":{"id":48446127,"name":"embd","full_name":"wujiang/embd","owner":{"login":"wujiang","id":77030,"avatar_url":"https://avatars.githubusercontent.com/u/77030?v=3","gravatar_id":"","url":"https://api.github.com/users/wujiang","html_url":"https://github.com/wujiang","followers_url":"https://api.github.com/users/wujiang/followers","following_url":"https://api.github.com/users/wujiang/following{/other_user}","gists_url":"https://api.github.com/users/wujiang/gists{/gist_id}","starred_url":"https://api.github.com/users/wujiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wujiang/subscriptions","organizations_url":"https://api.github.com/users/wujiang/orgs","repos_url":"https://api.github.com/users/wujiang/repos","events_url":"https://api.github.com/users/wujiang/events{/privacy}","received_events_url":"https://api.github.com/users/wujiang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wujiang/embd","description":"Embedded Programming Framework in Go","fork":true,"url":"https://api.github.com/repos/wujiang/embd","forks_url":"https://api.github.com/repos/wujiang/embd/forks","keys_url":"https://api.github.com/repos/wujiang/embd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wujiang/embd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wujiang/embd/teams","hooks_url":"https://api.github.com/repos/wujiang/embd/hooks","issue_events_url":"https://api.github.com/repos/wujiang/embd/issues/events{/number}","events_url":"https://api.github.com/repos/wujiang/embd/events","assignees_url":"https://api.github.com/repos/wujiang/embd/assignees{/user}","branches_url":"https://api.github.com/repos/wujiang/embd/branches{/branch}","tags_url":"https://api.github.com/repos/wujiang/embd/tags","blobs_url":"https://api.github.com/repos/wujiang/embd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wujiang/embd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wujiang/embd/git/refs{/sha}","trees_url":"https://api.github.com/repos/wujiang/embd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wujiang/embd/statuses/{sha}","languages_url":"https://api.github.com/repos/wujiang/embd/languages","stargazers_url":"https://api.github.com/repos/wujiang/embd/stargazers","contributors_url":"https://api.github.com/repos/wujiang/embd/contributors","subscribers_url":"https://api.github.com/repos/wujiang/embd/subscribers","subscription_url":"https://api.github.com/repos/wujiang/embd/subscription","commits_url":"https://api.github.com/repos/wujiang/embd/commits{/sha}","git_commits_url":"https://api.github.com/repos/wujiang/embd/git/commits{/sha}","comments_url":"https://api.github.com/repos/wujiang/embd/comments{/number}","issue_comment_url":"https://api.github.com/repos/wujiang/embd/issues/comments{/number}","contents_url":"https://api.github.com/repos/wujiang/embd/contents/{+path}","compare_url":"https://api.github.com/repos/wujiang/embd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wujiang/embd/merges","archive_url":"https://api.github.com/repos/wujiang/embd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wujiang/embd/downloads","issues_url":"https://api.github.com/repos/wujiang/embd/issues{/number}","pulls_url":"https://api.github.com/repos/wujiang/embd/pulls{/number}","milestones_url":"https://api.github.com/repos/wujiang/embd/milestones{/number}","notifications_url":"https://api.github.com/repos/wujiang/embd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wujiang/embd/labels{/name}","releases_url":"https://api.github.com/repos/wujiang/embd/releases{/id}","created_at":"2015-12-22T17:50:53Z","updated_at":"2015-12-22T17:50:54Z","pushed_at":"2015-12-29T02:03:20Z","git_url":"git://github.com/wujiang/embd.git","ssh_url":"git@github.com:wujiang/embd.git","clone_url":"https://github.com/wujiang/embd.git","svn_url":"https://github.com/wujiang/embd","homepage":"http://embd.io","size":1930,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kidoman:master","ref":"master","sha":"bfcd1345fe4e3d17ca82475c0c2f3d53120f87a9","user":{"login":"kidoman","id":206677,"avatar_url":"https://avatars.githubusercontent.com/u/206677?v=3","gravatar_id":"","url":"https://api.github.com/users/kidoman","html_url":"https://github.com/kidoman","followers_url":"https://api.github.com/users/kidoman/followers","following_url":"https://api.github.com/users/kidoman/following{/other_user}","gists_url":"https://api.github.com/users/kidoman/gists{/gist_id}","starred_url":"https://api.github.com/users/kidoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kidoman/subscriptions","organizations_url":"https://api.github.com/users/kidoman/orgs","repos_url":"https://api.github.com/users/kidoman/repos","events_url":"https://api.github.com/users/kidoman/events{/privacy}","received_events_url":"https://api.github.com/users/kidoman/received_events","type":"User","site_admin":false},"repo":{"id":15022976,"name":"embd","full_name":"kidoman/embd","owner":{"login":"kidoman","id":206677,"avatar_url":"https://avatars.githubusercontent.com/u/206677?v=3","gravatar_id":"","url":"https://api.github.com/users/kidoman","html_url":"https://github.com/kidoman","followers_url":"https://api.github.com/users/kidoman/followers","following_url":"https://api.github.com/users/kidoman/following{/other_user}","gists_url":"https://api.github.com/users/kidoman/gists{/gist_id}","starred_url":"https://api.github.com/users/kidoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kidoman/subscriptions","organizations_url":"https://api.github.com/users/kidoman/orgs","repos_url":"https://api.github.com/users/kidoman/repos","events_url":"https://api.github.com/users/kidoman/events{/privacy}","received_events_url":"https://api.github.com/users/kidoman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kidoman/embd","description":"Embedded Programming Framework in Go","fork":false,"url":"https://api.github.com/repos/kidoman/embd","forks_url":"https://api.github.com/repos/kidoman/embd/forks","keys_url":"https://api.github.com/repos/kidoman/embd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kidoman/embd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kidoman/embd/teams","hooks_url":"https://api.github.com/repos/kidoman/embd/hooks","issue_events_url":"https://api.github.com/repos/kidoman/embd/issues/events{/number}","events_url":"https://api.github.com/repos/kidoman/embd/events","assignees_url":"https://api.github.com/repos/kidoman/embd/assignees{/user}","branches_url":"https://api.github.com/repos/kidoman/embd/branches{/branch}","tags_url":"https://api.github.com/repos/kidoman/embd/tags","blobs_url":"https://api.github.com/repos/kidoman/embd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kidoman/embd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kidoman/embd/git/refs{/sha}","trees_url":"https://api.github.com/repos/kidoman/embd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kidoman/embd/statuses/{sha}","languages_url":"https://api.github.com/repos/kidoman/embd/languages","stargazers_url":"https://api.github.com/repos/kidoman/embd/stargazers","contributors_url":"https://api.github.com/repos/kidoman/embd/contributors","subscribers_url":"https://api.github.com/repos/kidoman/embd/subscribers","subscription_url":"https://api.github.com/repos/kidoman/embd/subscription","commits_url":"https://api.github.com/repos/kidoman/embd/commits{/sha}","git_commits_url":"https://api.github.com/repos/kidoman/embd/git/commits{/sha}","comments_url":"https://api.github.com/repos/kidoman/embd/comments{/number}","issue_comment_url":"https://api.github.com/repos/kidoman/embd/issues/comments{/number}","contents_url":"https://api.github.com/repos/kidoman/embd/contents/{+path}","compare_url":"https://api.github.com/repos/kidoman/embd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kidoman/embd/merges","archive_url":"https://api.github.com/repos/kidoman/embd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kidoman/embd/downloads","issues_url":"https://api.github.com/repos/kidoman/embd/issues{/number}","pulls_url":"https://api.github.com/repos/kidoman/embd/pulls{/number}","milestones_url":"https://api.github.com/repos/kidoman/embd/milestones{/number}","notifications_url":"https://api.github.com/repos/kidoman/embd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kidoman/embd/labels{/name}","releases_url":"https://api.github.com/repos/kidoman/embd/releases{/id}","created_at":"2013-12-08T12:08:47Z","updated_at":"2015-12-28T06:35:45Z","pushed_at":"2015-12-28T23:58:34Z","git_url":"git://github.com/kidoman/embd.git","ssh_url":"git@github.com:kidoman/embd.git","clone_url":"https://github.com/kidoman/embd.git","svn_url":"https://github.com/kidoman/embd","homepage":"http://embd.io","size":1951,"stargazers_count":599,"watchers_count":599,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":56,"mirror_url":null,"open_issues_count":19,"forks":56,"open_issues":19,"watchers":599,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kidoman/embd/pulls/44"},"html":{"href":"https://github.com/kidoman/embd/pull/44"},"issue":{"href":"https://api.github.com/repos/kidoman/embd/issues/44"},"comments":{"href":"https://api.github.com/repos/kidoman/embd/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/kidoman/embd/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/kidoman/embd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kidoman/embd/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/kidoman/embd/statuses/ad34e62432ea032b9dc4c4ea8dbab1e6bee9b9c1"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":4,"deletions":3,"changed_files":1}}