{"id":208092,"date":"2025-07-08T12:05:24","date_gmt":"2025-07-08T04:05:24","guid":{"rendered":"https:\/\/server.hk\/cnblog\/208092\/"},"modified":"2025-07-08T12:05:24","modified_gmt":"2025-07-08T04:05:24","slug":"%e5%b0%86go%e9%a1%b9%e7%9b%ae%e4%b8%8a%e4%bc%a0%e5%88%b0github%e5%ad%98%e5%82%a8%e5%ba%93","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/208092\/","title":{"rendered":"\u5c06Go\u9879\u76ee\u4e0a\u4f20\u5230GitHub\u5b58\u50a8\u5e93"},"content":{"rendered":"<p><b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span> <span>&gt;<\/span> <span>&gt;<\/span> <span>&gt;<\/span> <span>\u5c06Go\u9879\u76ee\u4e0a\u4f20\u5230GitHub\u5b58\u50a8\u5e93<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-28 21:54:35<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u5927\u5bb6\u597d\uff0c\u4eca\u5929\u672c\u4eba\u7ed9\u5927\u5bb6\u5e26\u6765\u6587\u7ae0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5c06Go\u9879\u76ee\u4e0a\u4f20\u5230GitHub\u5b58\u50a8\u5e93\u300b<\/span>\uff0c\u6587\u4e2d\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span><\/span>\uff0c\u5982\u679c\u4f60\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u65b9\u9762\u7684\u77e5\u8bc6\u70b9\u611f\u5174\u8da3\uff0c\u90a3\u5c31\u8bf7\u5404\u4f4d\u670b\u53cb\u7ee7\u7eed\u770b\u4e0b\u53bb\u5427~\u5e0c\u671b\u80fd\u771f\u6b63\u5e2e\u5230\u4f60\u4eec\uff0c\u8c22\u8c22\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u5982\u4f55\u6210\u529f\u5730\u5c06\u6211\u7684 Go \u9879\u76ee\u4e0a\u4f20\u5230\u73b0\u6709\u7684 github \u5b58\u50a8\u5e93\uff1f\u8fd9\u662f\u6211\u7684 <strong>$GOPATH<\/strong> \u7684\u6837\u5b50\uff1a<code>\/home\/user\/go<\/code>\u3002<\/p>\n<p>\u5728\u90a3\u91cc\u6211\u521b\u5efa\u4e86\u4ee5\u4e0b\u76ee\u5f55\uff1a <strong><code>src\/github.com\/StefanCepa\/<\/code><\/strong> \u3002\u5728\u8be5\u76ee\u5f55\u4e2d\uff0c\u6211\u6709 2 \u4e2a\u76ee\u5f55\uff0c\u5b83\u4eec\u4ee3\u8868\u4e24\u4e2a\u4e0d\u540c\u7684\u9879\u76ee\u3002\u6211\u5e0c\u671b\u6bcf\u4e2a\u9879\u76ee\u90fd\u53d1\u5e03\u5230\u5355\u72ec\u7684 github \u5b58\u50a8\u5e93\u4e0a\u3002<\/p>\n<p>\u6709\u4ec0\u4e48\u60f3\u6cd5\u6211\u8be5\u600e\u4e48\u505a\u5417\uff1f\u5728 github \u4e0a\u63d0\u4ea4\u7528 Go \u7f16\u5199\u7684\u4e1c\u897f\u8ba9\u6211\u6709\u70b9\u56f0\u60d1\u3002<\/p>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u8fd9\u4e0e\u521d\u59cb\u5316\u548c\u63d0\u4ea4\u65b0\u5b58\u50a8\u5e93\u7684\u65b9\u5f0f\u76f8\u540c\uff0c\u65e0\u8bba\u8bed\u8a00\u5982\u4f55\u3002<\/p>\n<p>\u5f97\u76ca\u4e8e $gopath \u548c\u8be5\u8bed\u8a00\u7684\u6807\u51c6\uff0cgo \u8ba9\u60a8\u66f4\u5bb9\u6613\u627e\u5230\u5176\u4ed6 go \u9879\u76ee\u3002\u4e0b\u9762\u662f\u7b80\u5355\u7684\u4f8b\u5b50\u3002<\/p>\n<p><em>\u5728\u9879\u76ee 1 \u5185\uff1a<\/em><\/p>\n<pre>$ cd ~\/go\/src\/github.com\/StefanCepa\/projectOne\/\n$ git init\n$ git add .\n$ git commit -m 'init'\n$ git remote add origin https:\/\/github.com\/StefanCepa\/projectOne.git\n$ git push -u origin master<\/pre>\n<p><em>\u5728\u9879\u76ee 2 \u5185\uff1a<\/em> <\/p>\n<p>*\u4e0e\u4e0a\u9762\u76f8\u540c\u7684\u8fc7\u7a0b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300a\u5c06Go\u9879\u76ee\u4e0a\u4f20\u5230GitHub\u5b58\u50a8\u5e93\u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-208092","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=208092"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208092\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=208092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=208092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=208092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}