{"id":42639,"date":"2024-12-01T09:51:08","date_gmt":"2024-12-01T01:51:08","guid":{"rendered":"https:\/\/fwq.ai\/blog\/42639\/"},"modified":"2024-12-01T09:51:08","modified_gmt":"2024-12-01T01:51:08","slug":"go%e5%8c%85%e5%ae%89%e8%a3%85%e5%90%8e%e6%97%a0%e6%b3%95%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/42639\/","title":{"rendered":"Go\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528"},"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>Go\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528<\/span><\/p>\n<h1>Go\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528<\/h1>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-24 19:51:34<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u5077\u5077\u52aa\u529b\uff0c\u6084\u65e0\u58f0\u606f\u5730\u53d8\u5f3a\uff0c\u7136\u540e\u60ca\u8273\u6240\u6709\u4eba\uff01\u54c8\u54c8\uff0c\u5c0f\u4f19\u4f34\u4eec\u53c8\u6765\u5b66\u4e60\u5566~\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aGo\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528\u300b<\/span>\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u4e0d\u77e5\u9053\u5927\u5bb6\u5bf9\u5176\u90fd\u6709\u591a\u5c11\u4e86\u89e3\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u4e00\u8d77\u6765\u770b\u4e00\u5427\uff01\u5f53\u7136\uff0c\u975e\u5e38\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u8bc4\u8bba\uff0c\u7ed9\u51fa\u5408\u7406\u7684\u5efa\u8bae\uff0c\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\uff0c\u4e00\u8d77\u8fdb\u6b65\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u6700\u8fd1\u4e3a\u6211\u7684 go \u5165\u95e8\u9879\u76ee\u4e4b\u4e00\u5b89\u88c5\u4e86\u4e00\u4e2a\u540d\u4e3a go-bindata \u7684\u65b0\u8f6f\u4ef6\u5305\uff0c\u6211\u5df2\u6309\u7167\u5b89\u88c5\u6307\u5357\u8fdb\u884c\u64cd\u4f5c\uff0c\u4f46\u5728\u6211\u5c1d\u8bd5\u8fd0\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u51fa\u73b0\u4e86\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<pre>$ go-bindata\nbash: go-bindata: command not found\n<\/pre>\n<p>\u6211\u5728stackoverflow\u4e0a\u63d0\u5230\u4e86\u4e00\u4e2a\u7c7b\u4f3c\u7684\u95ee\u9898\uff0c\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6848\u662f\u8bbe\u7f6e<code>$gopath<\/code>\uff0c\u6211\u5728windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u5e76\u4e14\u6211\u5df2\u7ecf\u5728<code>$path<\/code>\u4e2d\u914d\u7f6e\u4e86\u6211\u7684<code>$gopath<\/code>\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6211\u4e0d\u77e5\u9053\u6211\u54ea\u4e00\u6b65\u9519\u4e86\u3002<\/p>\n<p>\u73af\u5883\u53d8\u91cf\u548c\u8def\u5f84<\/p>\n<p>\uff08\u5bf9\u4e8e\u6240\u9644\u56fe\u7247\u7ed9\u60a8\u5e26\u6765\u7684\u4e0d\u4fbf\uff0c\u6211\u6df1\u8868\u6b49\u610f\uff0c\u56e0\u4e3a\u6211\u4e0d\u5141\u8bb8\u5c06\u56fe\u7247\u76f4\u63a5\u9644\u52a0\u5230\u5e16\u5b50\u4e2d\u3002\uff09<\/p>\n<p> <\/p>\n<h2>\u6b63\u786e\u7b54\u6848<\/h2>\n<p> <\/p>\n<p>\u8981\u4f7f\u7528\u73b0\u4ee3\u7248\u672c\u7684 go \u6267\u884c\u5b89\u88c5\uff0c\u60a8\u5e94\u8be5\u8fd0\u884c\uff1a<\/p>\n<pre>go install github.com\/go-bindata\/go-bindata\/go-bindata@latest<\/pre>\n<p>\u6b64\u547d\u4ee4\u5c06\u7f16\u8bd1\u4e8c\u8fdb\u5236\u6587\u4ef6\u5e76\u5c06\u5176\u653e\u5165\u8ba1\u7b97\u673a\u4e0a\u7684 <code>gopath\\bin<\/code> \u6587\u4ef6\u5939\u4e2d\uff0c\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u80fd\u591f\u4ece\u4efb\u4f55\u5730\u65b9\u8fd0\u884c\u5b83\uff0c\u5219\u5e94\u5c06 <code>gopath\\bin<\/code> \u6dfb\u52a0\u5230 <code>path<\/code> \u4e2d\u3002<\/p>\n<p>\u7136\u540e\u5c1d\u8bd5\u8fd0\u884c\u5b83\uff1a<\/p>\n<pre>go-bindata<\/pre>\n<p>\u7531\u4e8e\u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u7684\u539f\u56e0\uff0c\u91cd\u590d\u6709\u70b9\u5c34\u5c2c\u3002\u7b2c\u4e00\u4e2a <code>go-bindata<\/code> \u662f github \u7528\u6237\u540d\uff0c\u7b2c\u4e8c\u4e2a\u662f\u9879\u76ee\u540d\u79f0\uff0c\u7b2c\u4e09\u4e2a\u662f\u7a0b\u5e8f\u4e3b\u5305\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300aGo\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~\u7c73\u4e91\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03Golang\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &gt; &gt; Go\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528 Go\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528 \u6765\u6e90\uff1astackoverflow 2024-04-24 19:51:34 0\u6d4f\u89c8 \u6536\u85cf \u5077\u5077\u52aa\u529b\uff0c\u6084\u65e0\u58f0\u606f\u5730\u53d8\u5f3a\uff0c\u7136\u540e\u60ca\u8273\u6240\u6709\u4eba\uff01\u54c8\u54c8\uff0c\u5c0f\u4f19\u4f34\u4eec\u53c8\u6765\u5b66\u4e60\u5566~\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u300aGo\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528\u300b\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4f1a\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u4e0d\u77e5\u9053\u5927\u5bb6\u5bf9\u5176\u90fd\u6709\u591a\u5c11\u4e86\u89e3\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u4e00\u8d77\u6765\u770b\u4e00\u5427\uff01\u5f53\u7136\uff0c\u975e\u5e38\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u8bc4\u8bba\uff0c\u7ed9\u51fa\u5408\u7406\u7684\u5efa\u8bae\uff0c\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\uff0c\u4e00\u8d77\u8fdb\u6b65\uff01 \u95ee\u9898\u5185\u5bb9 \u6211\u6700\u8fd1\u4e3a\u6211\u7684 go \u5165\u95e8\u9879\u76ee\u4e4b\u4e00\u5b89\u88c5\u4e86\u4e00\u4e2a\u540d\u4e3a go-bindata \u7684\u65b0\u8f6f\u4ef6\u5305\uff0c\u6211\u5df2\u6309\u7167\u5b89\u88c5\u6307\u5357\u8fdb\u884c\u64cd\u4f5c\uff0c\u4f46\u5728\u6211\u5c1d\u8bd5\u8fd0\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u51fa\u73b0\u4e86\u8fd9\u4e2a\u95ee\u9898\u3002 $ go-bindata bash: go-bindata: command not found \u6211\u5728stackoverflow\u4e0a\u63d0\u5230\u4e86\u4e00\u4e2a\u7c7b\u4f3c\u7684\u95ee\u9898\uff0c\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6848\u662f\u8bbe\u7f6e$gopath\uff0c\u6211\u5728windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u5e76\u4e14\u6211\u5df2\u7ecf\u5728$path\u4e2d\u914d\u7f6e\u4e86\u6211\u7684$gopath\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6211\u4e0d\u77e5\u9053\u6211\u54ea\u4e00\u6b65\u9519\u4e86\u3002 \u73af\u5883\u53d8\u91cf\u548c\u8def\u5f84 \uff08\u5bf9\u4e8e\u6240\u9644\u56fe\u7247\u7ed9\u60a8\u5e26\u6765\u7684\u4e0d\u4fbf\uff0c\u6211\u6df1\u8868\u6b49\u610f\uff0c\u56e0\u4e3a\u6211\u4e0d\u5141\u8bb8\u5c06\u56fe\u7247\u76f4\u63a5\u9644\u52a0\u5230\u5e16\u5b50\u4e2d\u3002\uff09 \u6b63\u786e\u7b54\u6848 \u8981\u4f7f\u7528\u73b0\u4ee3\u7248\u672c\u7684 go \u6267\u884c\u5b89\u88c5\uff0c\u60a8\u5e94\u8be5\u8fd0\u884c\uff1a go install github.com\/go-bindata\/go-bindata\/go-bindata@latest \u6b64\u547d\u4ee4\u5c06\u7f16\u8bd1\u4e8c\u8fdb\u5236\u6587\u4ef6\u5e76\u5c06\u5176\u653e\u5165\u8ba1\u7b97\u673a\u4e0a\u7684 gopath\\bin \u6587\u4ef6\u5939\u4e2d\uff0c\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u80fd\u591f\u4ece\u4efb\u4f55\u5730\u65b9\u8fd0\u884c\u5b83\uff0c\u5219\u5e94\u5c06 gopath\\bin \u6dfb\u52a0\u5230 path \u4e2d\u3002 \u7136\u540e\u5c1d\u8bd5\u8fd0\u884c\u5b83\uff1a go-bindata \u7531\u4e8e\u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u7684\u539f\u56e0\uff0c\u91cd\u590d\u6709\u70b9\u5c34\u5c2c\u3002\u7b2c\u4e00\u4e2a go-bindata \u662f github \u7528\u6237\u540d\uff0c\u7b2c\u4e8c\u4e2a\u662f\u9879\u76ee\u540d\u79f0\uff0c\u7b2c\u4e09\u4e2a\u662f\u7a0b\u5e8f\u4e3b\u5305\u7684\u4f4d\u7f6e\u3002 \u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300aGo\u5305\u5b89\u88c5\u540e\u65e0\u6cd5\u4f7f\u7528\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~\u7c73\u4e91\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03Golang\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-42639","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/42639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=42639"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/42639\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=42639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=42639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=42639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}