{"action":"closed","issue":{"url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/18","labels_url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/18/comments","events_url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/18/events","html_url":"https://github.com/LeslieZhu/MinYi/issues/18","id":121420093,"number":18,"title":"建立Golang开发环境","user":{"login":"LeslieZhu","id":2840435,"avatar_url":"https://avatars.githubusercontent.com/u/2840435?v=3","gravatar_id":"","url":"https://api.github.com/users/LeslieZhu","html_url":"https://github.com/LeslieZhu","followers_url":"https://api.github.com/users/LeslieZhu/followers","following_url":"https://api.github.com/users/LeslieZhu/following{/other_user}","gists_url":"https://api.github.com/users/LeslieZhu/gists{/gist_id}","starred_url":"https://api.github.com/users/LeslieZhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeslieZhu/subscriptions","organizations_url":"https://api.github.com/users/LeslieZhu/orgs","repos_url":"https://api.github.com/users/LeslieZhu/repos","events_url":"https://api.github.com/users/LeslieZhu/events{/privacy}","received_events_url":"https://api.github.com/users/LeslieZhu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LeslieZhu/MinYi/labels/Go","name":"Go","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/LeslieZhu/MinYi/milestones/3","html_url":"https://github.com/LeslieZhu/MinYi/milestones/2015-week-50","labels_url":"https://api.github.com/repos/LeslieZhu/MinYi/milestones/3/labels","id":1446401,"number":3,"title":"2015-week-50","description":"2015年第50周，多看书，少说话。","creator":{"login":"LeslieZhu","id":2840435,"avatar_url":"https://avatars.githubusercontent.com/u/2840435?v=3","gravatar_id":"","url":"https://api.github.com/users/LeslieZhu","html_url":"https://github.com/LeslieZhu","followers_url":"https://api.github.com/users/LeslieZhu/followers","following_url":"https://api.github.com/users/LeslieZhu/following{/other_user}","gists_url":"https://api.github.com/users/LeslieZhu/gists{/gist_id}","starred_url":"https://api.github.com/users/LeslieZhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeslieZhu/subscriptions","organizations_url":"https://api.github.com/users/LeslieZhu/orgs","repos_url":"https://api.github.com/users/LeslieZhu/repos","events_url":"https://api.github.com/users/LeslieZhu/events{/privacy}","received_events_url":"https://api.github.com/users/LeslieZhu/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":5,"state":"open","created_at":"2015-12-06T15:46:59Z","updated_at":"2015-12-10T07:22:02Z","due_on":"2015-12-12T16:00:00Z","closed_at":null},"comments":0,"created_at":"2015-12-10T07:12:45Z","updated_at":"2015-12-10T07:22:02Z","closed_at":"2015-12-10T07:22:02Z","body":"# 建立Golang开发环境\r\n\r\n## 安装Golang\r\n\r\n```\r\n$ brew install go\r\n```\r\n\r\n## 设置环境变量GOROOT\r\n\r\n```\r\n$ which go\r\n/usr/local/bin/go\r\n$ readlink /usr/local/bin/go\r\n../Cellar/go/1.4.1/bin/go\r\n$ echo $GOROOT\r\n/usr/local/Cellar/go/1.4.1/libexec/\r\n```\r\n\r\n\r\n## 设置环境变量GOPATH\r\n\r\nGolang有工作区的概念，一个工作区包含三个子目录:\r\n\r\n- src\r\n- pkg\r\n- bin\r\n\r\n而GOPATH变量就是该工作区目录的路径:\r\n\r\n```\r\nexport GOPATH=/Users/LeslieZhu/golang/\r\nexport PATH=$PATH:$GOPATH/bin/\r\n```"}}