{"id":207811,"date":"2025-07-08T14:32:53","date_gmt":"2025-07-08T06:32:53","guid":{"rendered":"https:\/\/server.hk\/cnblog\/207811\/"},"modified":"2025-07-08T14:32:53","modified_gmt":"2025-07-08T06:32:53","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-github-%e4%b8%8a%e8%ae%be%e7%bd%ae%e6%88%91%e7%9a%84-golang-%e9%a1%b9%e7%9b%ae%e7%89%88%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/207811\/","title":{"rendered":"\u5982\u4f55\u5728 Github \u4e0a\u8bbe\u7f6e\u6211\u7684 Golang \u9879\u76ee\u7248\u672c"},"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>\u5982\u4f55\u5728 Github \u4e0a\u8bbe\u7f6e\u6211\u7684 Golang \u9879\u76ee\u7248\u672c<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-25 19:51:29<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u5728 Github \u4e0a\u8bbe\u7f6e\u6211\u7684 Golang \u9879\u76ee\u7248\u672c\u300b<\/span>\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u521b\u5efa\u4e86\u4e00\u4e2a golang \u9879\u76ee\u3002\u4f7f\u7528 dep \u4f5c\u4e3a\u4f9d\u8d56\u7ba1\u7406\u3002\u6211\u53ef\u4ee5\u5f15\u5165<code>github.com\/gin-gonic\/gin<\/code> v1.4.0\uff0c\u4f46\u6211\u4e0d\u77e5\u9053\u5982\u4f55\u5728\u6211\u7684\u9879\u76ee\u4e2d\u8bbe\u7f6e\u8fd9\u4e2a\u7248\u672c\u3002 <\/p>\n<p>\u6211\u6b63\u5728\u5c1d\u8bd5\u521b\u5efa\u4e00\u4e2a\u529f\u80fd\u3002 <code>git checkout -b bate-0.0.1<\/code><\/p>\n<p>\u4fee\u6539gopkg.toml\u6587\u4ef6\u65f6\u51fa\u73b0\u9519\u8bef<\/p>\n<pre>solving failure: no versions of github.com\/sillyhatxu\/go-utils met constraints:\n        master: could not introduce github.com\/sillyhatxu\/go-utils@master, as it is not allowed by constraint beta-0.0.1 from project aftersales-backend.\n        beta-0.0.1: could not introduce github.com\/sillyhatxu\/[email&nbsp;protected], as it is not allowed by constraint beta-0.0.1 from project aftersales-backend.<\/pre>\n<pre>[[constraint]]\n  name = \"github.com\/sillyhatxu\/go-utils\"\n  version = \"beta-0.0.1\"<\/pre>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u6211\u4e00\u76f4\u5728\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 golang\u4f7f\u7528git\u7684tag\u529f\u80fd\u8fdb\u884c\u7248\u672c\u63a7\u5236\u3002<\/p>\n<pre>git tag v0.0.1\n\ngit push origin --tags v0.0.1<\/pre>\n<h3>gopkg.toml<\/h3>\n<pre>[[constraint]]\n  name = \"github.com\/sillyhatxu\/go-utils\"\n  version = \"0.0.1\"<\/pre>\n<p>\u6587\u4e2d\u5173\u4e8e\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300a\u5982\u4f55\u5728 Github \u4e0a\u8bbe\u7f6e\u6211\u7684 Golang \u9879\u76ee\u7248\u672c\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/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-207811","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207811","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=207811"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207811\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=207811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=207811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=207811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}