{"id":125584,"date":"2020-06-27T18:52:34","date_gmt":"2020-06-27T10:52:34","guid":{"rendered":"http:\/\/4563.org\/?p=125584"},"modified":"2020-06-27T18:52:34","modified_gmt":"2020-06-27T10:52:34","slug":"golang-%e6%9c%89%e6%b2%a1%e6%9c%89%e6%9b%b4%e5%8a%a8%e6%80%81%e5%8c%96%e6%9b%b4%e5%bc%ba%e5%a4%a7%e7%9a%84%e5%8f%8d%e5%b0%84","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=125584","title":{"rendered":"golang \u6709\u6ca1\u6709\u66f4\u52a8\u6001\u5316,\u66f4\u5f3a\u5927\u7684\u53cd\u5c04?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  golang \u6709\u6ca1\u6709\u66f4\u52a8\u6001\u5316,\u66f4\u5f3a\u5927\u7684\u53cd\u5c04?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DavidNineRoc <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>RT, \u6bd4\u5982\u6211\u6709\u4e00\u4e2a\u6587\u4ef6\u5939 <code>\/commands<\/code> \u91cc\u9762\u6709\u4e00\u5806\u5de5\u5177\u811a\u672c, \u6211\u600e\u4e48\u53ef\u4ee5\u52a8\u6001\u6765\u8c03\u7528?<\/p>\n<h3>\u5b9e\u9645\u6548\u679c<\/h3>\n<p>\u901a\u8fc7<code>cli<\/code>\u8c03\u7528,\u8f93\u5165<code>\/commands<\/code>\u91cc\u7ed3\u6784\u4f53\u7684\u540d\u5b57,\u53ef\u4ee5\u52a8\u6001\u8c03\u7528\u8fd9\u4e2a\u7ed3\u6784\u4f53\u7684\u65b9\u6cd5<\/p>\n<ul>\n<li>\u60f3\u901a\u8fc7\u52a8\u6001<code>import<\/code>\u7136\u540e<code>init<\/code>\u8c03\u7528,\u8bed\u6cd5\u76f4\u63a5\u4e0d\u652f\u6301<\/li>\n<li><code>commands<\/code>\u6bcf\u4e00\u4e2a\u7ed3\u6784\u4f53\u5b9e\u73b0\u63a5\u53e3, \u6700\u540e\u901a\u8fc7\u63a5\u53e3\u53bb\u8c03\u7528, \u8c01\u77e5 golang \u5c45\u7136\u4e0d\u652f\u6301\u5b57\u7b26\u4e32\u7684\u53cd\u5c04,\u8bf4\u5b9e\u8bdd\u6709\u70b9\u9e21\u808b\u4e86.<\/li>\n<\/ul>\n<p>\u641c\u4e86\u4e00\u4e0b\u5e16\u5b50,\u8bf4\u662f\u5728\u5916\u90e8\u6ce8\u518c\u4e00\u4e2a\u5168\u5c40 map \u7c7b,\u4e0d\u8fc7\u8fd9\u6837\u505a\u8fd8\u662f\u6709\u7f3a\u9677\u4e0d\u662f\u6211\u60f3\u8981\u7684\u90a3\u79cd.<\/p>\n<p>\u6709\u5199\u8fc7\u7c7b\u4f3c\u670d\u52a1\u7684\u5927\u795e, \u6307\u70b9\u4e24\u62db<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2076823\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : virusdefender <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u65e2\u7136 golang \u4e86\uff0c\u5c31\u522b\u8003\u8651\u8fd9\u79cd\u95ee\u9898\u4e86\uff0c\u8fd8\u6709\u4e24\u4e2a\u529e\u6cd5<\/p>\n<p>1. \u6bcf\u4e2a command \u4e2d\u7684 init \u4e2d\u81ea\u5df1\u53bb\u4fee\u6539\u6ce8\u518c\u7684 map\uff0c\u800c\u4e0d\u662f\u5728\u4e00\u4e2a\u5730\u65b9\u5f15\u7528\u6240\u6709\u7684 command<br \/>2. go generate \u5199\u4e2a\u811a\u672c\u626b\u63cf\u4e00\u4e0b\uff0c\u7136\u540e\u751f\u6210\u4e00\u4e2a go \u6587\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076824\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : DavidNineRoc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @virusdefender \u5982\u679c\u6ce8\u518c\u7684 command \u548c\u8981\u8fd0\u884c\u7684\u4e0d\u5728\u540c\u4e00\u4e2a\u9879\u76ee\u8be5\u600e\u4e48\u5904\u7406.<br \/>\u5982\u679c\u6709\u4e00\u4e2a\u670d\u52a1 a, \u7c7b\u4f3c gofmt, \u7136\u540e\u9700\u8981\u8c03\u7528 command \u91cc\u7684\u6240\u6709\u547d\u4ee4. <\/p>\n<p>\u65b9\u6cd5 2 \u7834\u574f\u4ee3\u7801\u7ba1\u7406,\u751f\u6210\u65b0\u7684\u4e1c\u897f.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076825\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SingeeKing <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7f16\u8bd1\u578b\u8bed\u8a00\u90fd\u4e0d\u884c\u5427\uff0c\u9664\u975e\u5185\u7f6e\u4e00\u4e2a\u7f16\u8bd1\u5668\u5728\u8fd0\u884c\u65f6\u7f16\u8bd1\uff1b\u4e00\u4e2a\u53ef\u884c\u7684\u601d\u8def\u662f\u628a\u6bcf\u4e2a \/commands \u6587\u4ef6\u5206\u5f00\u7f16\u8bd1\u6210\u52a8\u6001\u94fe\u63a5\u5e93\uff0c\u7136\u540e\u8c03\u7528\u8fd9\u4e9b\u7f16\u8bd1\u597d\u7684 dll \u6216\u8005 so \u6587\u4ef6\u662f\u53ef\u4ee5\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076826\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dcalsky <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 rpc \u901a\u4fe1\u5373\u53ef\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076827\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ihidchaos <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             MethodByName \u8fd9\u6837\u5b50\u53cd\u5c04\u5462<br \/>https:\/\/www.cnblogs.com\/52php\/p\/6337420.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076828\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : DavidNineRoc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SingeeKing \u7f16\u8bd1\u8bed\u8a00\u4f1a\u6240\u6709\u51fd\u6570\u52a0\u8f7d\u5230\u4e00\u4e2a\u51fd\u6570\u8868\u5417?\u7136\u540e\u9760\u51fd\u6570\u7684\u540d\u5b57\u8c03\u7528\u4e0d.<br \/>@dcalsky \u9650\u5236\u4e86\u7528\u6237\u7c7b\u578b,\u60f3\u505a\u4e00\u4e2a\u5de5\u5177\u7c7b\u7684\u4e1c\u897f<br \/>@ihidchaos \u4e0d\u8db3,\u90fd\u5b9e\u4f8b\u5316\u4e86\u90a3\u4e2a\u7ed3\u6784\u4f53, \u8981\u662f\u5b9e\u4f8b\u5316\u7684\u7ed3\u6784\u4f53, golang \u5185\u7f6e\u7684\u53cd\u5c04\u591f\u8c03\u7528\u65b9\u6cd5\u4e86, \u73b0\u5728\u662f\u5b9e\u4f8b\u5316\u4e0d\u4e86\u7ed3\u6784\u4f53                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076829\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : locoz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5de5\u5177\u811a\u672c\uff1f\u90fd\u662f Go \u5199\u7684\uff1f\u4f60\u60f3\u7684\u662f\u90a3\u4e2a\u6587\u4ef6\u5939\u4e0b\u653e\u7684\u90fd\u662f.go \u6587\u4ef6\uff0c\u7136\u540e\u7528\u4e00\u4e2a\u7f16\u8bd1\u597d\u7684 go \u7a0b\u5e8f\u53bb\u52a8\u6001\u5730\u8c03\u7528\uff1f\u8fd8\u662f\u8bf4\u6587\u4ef6\u5939\u91cc\u662f\u4e00\u5806\u7f16\u8bd1\u597d\u7684 Go \u7a0b\u5e8f\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2076830\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : DavidNineRoc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @locoz \u7528 golang \u5199\u4e00\u4e2a\u5de5\u5177,\u7f16\u8bd1\u597d\u7684\u653e\u5165 go bin \u76ee\u5f55. \u7136\u540e\u53bb\u8c03\u7528\u5176\u5b83\u9879\u76ee\u91cc\u7684 commands \u6587\u4ef6\u5939\u4e0b\u7684 .go \u6587\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>golang \u6709\u6ca1\u6709\u66f4\u52a8\u6001\u5316,\u66f4\u5f3a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/125584"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125584"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/125584\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125584"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}