{"id":1672,"date":"2023-06-27T13:54:15","date_gmt":"2023-06-27T05:54:15","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1672"},"modified":"2023-06-27T13:54:15","modified_gmt":"2023-06-27T05:54:15","slug":"golang%e9%9d%a2%e8%af%95%e5%ae%9d%e5%85%b8-%e4%bd%bf%e7%94%a8go%e5%ae%9e%e7%8e%b023%e7%a7%8d%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f%e4%b9%8b%e7%bb%93%e6%9e%84%e5%9e%8b%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/go\/golang%e9%9d%a2%e8%af%95%e5%ae%9d%e5%85%b8-%e4%bd%bf%e7%94%a8go%e5%ae%9e%e7%8e%b023%e7%a7%8d%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f%e4%b9%8b%e7%bb%93%e6%9e%84%e5%9e%8b%e6%a8%a1%e5%bc%8f\/","title":{"rendered":"Golang\u9762\u8bd5\u5b9d\u5178\u2014\u2014\u4f7f\u7528Go\u5b9e\u73b023\u79cd\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u7ed3\u6784\u578b\u6a21\u5f0f\uff08\u4e0a\uff09"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"color: black;padding-right: 10px;padding-left: 10px;line-height: 1.6;letter-spacing: 0px;word-break: break-word;overflow-wrap: break-word;text-align: left;font-size: 14px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\">\n<h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(110, 150, 124);text-align: center;font-weight: bold;margin: 0.5em;\"><span style=\"padding-right: 1em;\">\/ <\/span><span style=\"display: none;\"><\/span>\u5173\u4e8eGolang\u9762\u8bd5\u5b9d\u5178<span style=\"padding-left: 1em;\">\/<\/span><\/h1>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;line-height: 26px;text-align: justify;\">\u6700\u8fd1\u51e0\u5e74\uff0cGo\u7684\u70ed\u5ea6\u6301\u7eed\u98d9\u5347\uff0c\u56fd\u5185\u5916\u5f88\u591a\u5927\u516c\u53f8\u90fd\u5728\u5927\u89c4\u6a21\u7684\u4f7f\u7528Go\u3002Google\u662fGo\u8bed\u8a00\u8bde\u751f\u7684\u5730\u65b9\uff0c\u5176\u4ed6\u516c\u53f8\u5982Facebook\u3001\u817e\u8baf\u3001\u963f\u91cc\u3001\u5b57\u8282\u8df3\u52a8\u3001\u767e\u5ea6\u3001\u4eac\u4e1c\u3001\u5c0f\u7c73\u7b49\u90fd\u5728\u62e5\u62b1\u548c\u8f6c\u5411Go\u3002Go\u8bed\u8a00\u7684\u5f00\u6e90\u9879\u76ee\u4e5f\u975e\u5e38\u591a\uff0c\u5982kubernetes\u3001docker\u3001etcd\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;line-height: 26px;text-align: justify;\">\u968f\u7740\u5e02\u573a\u5bf9Go\u8bed\u8a00\u4eba\u624d\u9700\u6c42\u7684\u589e\u957f\uff0c\u5f88\u591a\u5f00\u53d1\u8005\u90fd\u6295\u5165\u4e86Go\u8bed\u8a00\u7684\u6000\u62b1\u3002\u672c\u7cfb\u5217\u6587\u7ae0\u5c06\u4ee5\u7b2c\u4e00\u89c6\u89d2\u4e0e\u5927\u5bb6\u4e00\u540c\u5f00\u59cbGolang\u7684\u9762\u8bd5\u4e4b\u8def\uff0c\u5e0c\u671b\u5927\u5bb6\u80fd\u591f\u6709\u6240\u6536\u83b7\uff0c\u62ff\u4e0b\u5fc3\u4eea\u7684offer\u3002<\/p>\n<h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(110, 150, 124);text-align: center;font-weight: bold;margin: 0.5em;\"><span style=\"padding-right: 1em;\">\/ <\/span><span style=\"display: none;\"><\/span>\u4f7f\u7528Go\u5b9e\u73b023\u79cd\u8bbe\u8ba1\u6a21\u5f0f\u2014\u2014\u7ed3\u6784\u578b\u6a21\u5f0f\uff08\u4e0a\uff09<span style=\"padding-left: 1em;\">\/<\/span><\/h1>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgba(0, 0, 0, 0.6);font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\"><span style=\"display: none;\"><\/span>\u9002\u914d\u5668\u6a21\u5f0f<\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;line-height: 26px;text-align: justify;\">\u5c06\u4e00\u4e2a\u7c7b\u7684\u63a5\u53e3\u8f6c\u6362\u6210\u5ba2\u6237\u7aef\u5e0c\u671b\u7684\u53e6\u5916\u4e00\u4e2a\u63a5\u53e3\uff0c\u4f7f\u5f97\u539f\u672c\u7531\u4e8e\u63a5\u53e3\u4e0d\u517c\u5bb9\u800c\u4e0d\u80fd\u4e00\u8d77\u5de5\u4f5c\u7684\u90a3\u4e9b\u7c7b\u53ef\u4ee5\u4e00\u8d77\u5de5\u4f5c<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u9002\u7528\u573a\u666f<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4ee5\u524d\u5f00\u53d1\u7684\u7cfb\u7edf\u5b58\u5728\u6ee1\u8db3\u65b0\u7cfb\u7edf\u529f\u80fd\u9700\u6c42\u7684\u7c7b\uff0c\u4f46\u5176\u63a5\u53e3\u540c\u65b0\u7cfb\u7edf\u7684\u63a5\u53e3\u4e0d\u4e00\u81f4<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4f7f\u7528\u7b2c\u4e09\u65b9\u63d0\u4f9b\u7684\u7ec4\u4ef6\uff0c\u4f46\u7ec4\u4ef6\u63a5\u53e3\u5b9a\u4e49\u548c\u81ea\u5df1\u8981\u6c42\u7684\u63a5\u53e3\u5b9a\u4e49\u4e0d\u540c<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>Go\u8bed\u8a00\u5b9e\u73b0<span style=\"display: none;\"><\/span><\/h3>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;color: #abb2bf;background: #282c34;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;border-radius: 6px;padding: 1em;\"><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;MysqlDbInterface&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">interface<\/span>&nbsp;{<br  \/>&nbsp;InsertIntoDb()<br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;MysqlDb&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>&nbsp;DbName&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span><br  \/>}<br  \/><br  \/><span style=\"color: #5c6370;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7cfb\u7edf\u4e2d\u5b58\u5728\u7684\u63a5\u53e3\u65b9\u6cd5\uff1aInsertIntoDb<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*MysqlDb)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">InsertIntoDb<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;fmt.Printf(<span style=\"color: #98c379;line-height: 26px;\">\"hello,&nbsp;insert&nbsp;into&nbsp;mysql:&nbsp;%sn\"<\/span>,&nbsp;d.DbName)<br  \/>}<br  \/><br  \/><span style=\"color: #5c6370;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u65b0\u7684\u63a5\u53e3\u65b9\u6cd5\uff1aSaveToDb<\/span><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;DbInterface&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">interface<\/span>&nbsp;{<br  \/>&nbsp;SaveToDb()<br  \/>}<br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;MysqlDbAdapter&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>&nbsp;MysqlDbInterface<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(a&nbsp;*MysqlDbAdapter)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">SaveToDb<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;a.InsertIntoDb()<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">var<\/span>&nbsp;db&nbsp;DbInterface<br  \/>&nbsp;db&nbsp;=&nbsp;&amp;MysqlDbAdapter{MysqlDbInterface:&nbsp;&amp;MysqlDb{DbName:&nbsp;<span style=\"color: #98c379;line-height: 26px;\">\"mysql\"<\/span>}}<br  \/>&nbsp;db.SaveToDb()<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u9002\u914d\u5668\u6a21\u5f0f\u4f18\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u53ef\u4ee5\u8ba9\u4e24\u4e2a\u6ca1\u6709\u5173\u8054\u7684\u7c7b\u4e00\u8d77\u8fd0\u884c\uff0c\u590d\u7528\u4e86\u73b0\u6709\u7684\u7c7b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u76ee\u6807\u7c7b\u548c\u9002\u914d\u8005\u7c7b\u89e3\u8026\uff0c\u89e3\u51b3\u4e86\u76ee\u6807\u7c7b\u548c\u9002\u914d\u8005\u7c7b\u63a5\u53e3\u4e0d\u4e00\u81f4\u7684\u95ee\u9898<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u9002\u914d\u5668\u6a21\u5f0f\u7f3a\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u589e\u52a0\u4e86\u7cfb\u7edf\u7684\u590d\u6742\u6027<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u964d\u4f4e\u4e86\u4ee3\u7801\u53ef\u8bfb\u6027<\/section>\n<\/li>\n<\/ol>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgba(0, 0, 0, 0.6);font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\"><span style=\"display: none;\"><\/span>\u6865\u63a5\u6a21\u5f0f<\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;line-height: 26px;text-align: justify;\">\u5c06\u62bd\u8c61\u90e8\u5206\u4e0e\u5b83\u7684\u5b9e\u73b0\u90e8\u5206\u5206\u79bb\uff0c\u4f7f\u5b83\u4eec\u90fd\u53ef\u4ee5\u72ec\u7acb\u5730\u53d8\u5316<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u9002\u7528\u573a\u666f<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5982\u679c\u4e00\u4e2a\u7cfb\u7edf\u9700\u8981\u5728\u6784\u4ef6\u7684\u62bd\u8c61\u5316\u89d2\u8272\u548c\u5177\u4f53\u5316\u89d2\u8272\u4e4b\u95f4\u589e\u52a0\u66f4\u591a\u7684\u7075\u6d3b\u6027\uff0c\u907f\u514d\u5728\u4e24\u4e2a\u5c42\u6b21\u4e4b\u95f4\u5efa\u7acb\u9759\u6001\u7684\u7ee7\u627f\u8054\u7cfb\uff0c\u901a\u8fc7\u6865\u63a5\u6a21\u5f0f\u53ef\u4ee5\u4f7f\u5b83\u4eec\u5728\u62bd\u8c61\u5c42\u5efa\u7acb\u4e00\u4e2a\u5173\u8054\u5173\u7cfb<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4e0d\u5e0c\u671b\u4f7f\u7528\u7ee7\u627f\u6216\u56e0\u4e3a\u591a\u5c42\u6b21\u7ee7\u627f\u5bfc\u81f4\u7cfb\u7edf\u7c7b\u7684\u4e2a\u6570\u6025\u5267\u589e\u52a0\u7684\u7cfb\u7edf<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>Go\u8bed\u8a00\u5b9e\u73b0<span style=\"display: none;\"><\/span><\/h3>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;color: #abb2bf;background: #282c34;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;border-radius: 6px;padding: 1em;\"><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;MessageInterface&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">interface<\/span>&nbsp;{<br  \/>&nbsp;Send(msg&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span>)&nbsp;error<br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;EmailMessage&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(m&nbsp;*EmailMessage)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Send<\/span><span style=\"line-height: 26px;\">(msg&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span>)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">error<\/span><\/span>&nbsp;{<br  \/>&nbsp;fmt.Printf(<span style=\"color: #98c379;line-height: 26px;\">\"send&nbsp;%s\"<\/span>,&nbsp;msg)<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #56b6c2;line-height: 26px;\">nil<\/span><br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;NotificationInterface&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">interface<\/span>&nbsp;{<br  \/>&nbsp;Notify(msg&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span>)&nbsp;error<br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;InfoNotification&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>&nbsp;message&nbsp;MessageInterface<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">NewInfoNotification<\/span><span style=\"line-height: 26px;\">(message&nbsp;MessageInterface)<\/span>&nbsp;*<span style=\"color: #61aeee;line-height: 26px;\">InfoNotification<\/span><\/span>&nbsp;{<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;&amp;InfoNotification{message:&nbsp;message}<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(n&nbsp;*InfoNotification)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Notify<\/span><span style=\"line-height: 26px;\">(msg&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span>)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">error<\/span><\/span>&nbsp;{<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;n.message.Send(msg)<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;notify&nbsp;:=&nbsp;NewInfoNotification(&amp;EmailMessage{})<br  \/>&nbsp;err&nbsp;:=&nbsp;notify.Notify(<span style=\"color: #98c379;line-height: 26px;\">\"Info\"<\/span>)<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">if<\/span>&nbsp;err&nbsp;!=&nbsp;<span style=\"color: #56b6c2;line-height: 26px;\">nil<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span><br  \/>&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u6865\u63a5\u6a21\u5f0f\u4f18\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u62bd\u8c61\u4e0e\u5b9e\u73b0\u5206\u79bb\uff0c\u6269\u5c55\u80fd\u529b\u5f3a<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u7b26\u5408\u5f00\u95ed\u539f\u5219\u3001\u5408\u6210\u590d\u7528\u539f\u5219<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u6865\u63a5\u6a21\u5f0f\u7f3a\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u7531\u4e8e\u805a\u5408\u5173\u7cfb\u5efa\u7acb\u5728\u62bd\u8c61\u5c42\uff0c\u8981\u6c42\u5f00\u53d1\u8005\u9488\u5bf9\u62bd\u8c61\u5316\u8fdb\u884c\u8bbe\u8ba1\u4e0e\u7f16\u7a0b\uff0c\u80fd\u6b63\u786e\u5730\u8bc6\u522b\u51fa\u7cfb\u7edf\u4e2d\u4e24\u4e2a\u72ec\u7acb\u53d8\u5316\u7684\u7ef4\u5ea6\uff0c\u8fd9\u589e\u52a0\u4e86\u7cfb\u7edf\u7684\u7406\u89e3\u4e0e\u8bbe\u8ba1\u96be\u5ea6<\/section>\n<\/li>\n<\/ol>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgba(0, 0, 0, 0.6);font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\"><span style=\"display: none;\"><\/span>\u7ec4\u5408\u6a21\u5f0f<\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;line-height: 26px;text-align: justify;\">\u5c06\u5bf9\u8c61\u7ec4\u5408\u6210\u6811\u5f62\u7ed3\u6784\u4ee5\u8868\u793a\u201c\u90e8\u5206-\u6574\u4f53\u201d\u7684\u5c42\u6b21\u7ed3\u6784\uff0c\u4f7f\u5f97\u7528\u6237\u5bf9\u5355\u4e2a\u5bf9\u8c61\u548c\u7ec4\u5408\u5bf9\u8c61\u7684\u4f7f\u7528\u5177\u6709\u4e00\u81f4\u6027<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u9002\u7528\u573a\u666f<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u516c\u53f8\u90e8\u95e8\u67b6\u6784\u7b49\u573a\u666f<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>Go\u8bed\u8a00\u5b9e\u73b0<span style=\"display: none;\"><\/span><\/h3>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;color: #abb2bf;background: #282c34;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;border-radius: 6px;padding: 1em;\"><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;IOrganization&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">interface<\/span>&nbsp;{<br  \/>&nbsp;Count()&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">int<\/span><br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;Employee&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>&nbsp;Name&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span><br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(*Employee)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Count<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">int<\/span><\/span>&nbsp;{<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #d19a66;line-height: 26px;\">1<\/span><br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;Department&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">string<\/span><br  \/>&nbsp;SubOrganization&nbsp;[]IOrganization<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*Department)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Count<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"line-height: 26px;\">(count&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>)<\/span><\/span>&nbsp;{<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">for<\/span>&nbsp;_,&nbsp;organization&nbsp;:=&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">range<\/span>&nbsp;d.SubOrganization&nbsp;{<br  \/>&nbsp;&nbsp;count&nbsp;+=&nbsp;organization.Count()<br  \/>&nbsp;}<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;count<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*Department)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">AddOrganization<\/span><span style=\"line-height: 26px;\">(organization&nbsp;IOrganization)<\/span><\/span>&nbsp;{<br  \/>&nbsp;d.SubOrganization&nbsp;=&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">append<\/span>(d.SubOrganization,&nbsp;organization)<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u7ec4\u5408\u6a21\u5f0f\u4f18\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u7ec4\u5408\u6a21\u5f0f\u4f7f\u5f97\u5ba2\u6237\u7aef\u4ee3\u7801\u53ef\u4ee5\u4e00\u81f4\u5730\u5904\u7406\u5355\u4e2a\u5bf9\u8c61\u548c\u7ec4\u5408\u5bf9\u8c61\uff0c\u65e0\u987b\u5173\u5fc3\u81ea\u5df1\u5904\u7406\u7684\u662f\u5355\u4e2a\u5bf9\u8c61\uff0c\u8fd8\u662f\u7ec4\u5408\u5bf9\u8c61\uff0c\u8fd9\u7b80\u5316\u4e86\u5ba2\u6237\u7aef\u4ee3\u7801<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u66f4\u5bb9\u6613\u5728\u7ec4\u5408\u4f53\u5185\u52a0\u5165\u65b0\u7684\u5bf9\u8c61\uff0c\u5ba2\u6237\u7aef\u4e0d\u4f1a\u56e0\u4e3a\u52a0\u5165\u4e86\u65b0\u7684\u5bf9\u8c61\u800c\u66f4\u6539\u6e90\u4ee3\u7801\uff0c\u6ee1\u8db3\u201c\u5f00\u95ed\u539f\u5219\u201d<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u7ec4\u5408\u6a21\u5f0f\u7f3a\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u8bbe\u8ba1\u8f83\u590d\u6742\uff0c\u5ba2\u6237\u7aef\u9700\u8981\u82b1\u66f4\u591a\u65f6\u95f4\u7406\u6e05\u7c7b\u4e4b\u95f4\u7684\u5c42\u6b21\u5173\u7cfb<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4e0d\u5bb9\u6613\u9650\u5236\u5bb9\u5668\u4e2d\u7684\u6784\u4ef6\uff0c\u4e0d\u5bb9\u6613\u7528\u7ee7\u627f\u7684\u65b9\u6cd5\u6765\u589e\u52a0\u6784\u4ef6\u7684\u65b0\u529f\u80fd<\/section>\n<\/li>\n<\/ol>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgba(0, 0, 0, 0.6);font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\"><span style=\"display: none;\"><\/span>\u88c5\u9970\u6a21\u5f0f<\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;line-height: 26px;text-align: justify;\">\u5411\u73b0\u6709\u7684\u5bf9\u8c61\u6dfb\u52a0\u65b0\u7684\u529f\u80fd\uff0c\u540c\u65f6\u53c8\u4e0d\u6539\u53d8\u5176\u7ed3\u6784\uff0c\u5373\u52a8\u6001\u5730\u7ed9\u5bf9\u8c61\u6dfb\u52a0\u4e00\u4e9b\u989d\u5916\u7684\u529f\u80fd<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u9002\u7528\u573a\u666f<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5f53\u9700\u8981\u7ed9\u4e00\u4e2a\u73b0\u6709\u7c7b\u6dfb\u52a0\u9644\u52a0\u804c\u8d23\uff0c\u800c\u53c8\u4e0d\u80fd\u91c7\u7528\u751f\u6210\u5b50\u7c7b\u7684\u65b9\u6cd5\u8fdb\u884c\u6269\u5145\u65f6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5f53\u9700\u8981\u901a\u8fc7\u5bf9\u73b0\u6709\u7684\u4e00\u7ec4\u57fa\u672c\u529f\u80fd\u8fdb\u884c\u6392\u5217\u7ec4\u5408\u800c\u4ea7\u751f\u975e\u5e38\u591a\u7684\u529f\u80fd\u65f6\uff0c\u91c7\u7528\u7ee7\u627f\u5173\u7cfb\u5f88\u96be\u5b9e\u73b0\uff0c\u800c\u91c7\u7528\u88c5\u9970\u5668\u6a21\u5f0f\u5374\u5f88\u597d\u5b9e\u73b0<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5f53\u5bf9\u8c61\u7684\u529f\u80fd\u8981\u6c42\u53ef\u4ee5\u52a8\u6001\u5730\u6dfb\u52a0\uff0c\u4e5f\u53ef\u4ee5\u518d\u52a8\u6001\u5730\u64a4\u9500\u65f6<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>Go\u8bed\u8a00\u5b9e\u73b0<span style=\"display: none;\"><\/span><\/h3>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;color: #abb2bf;background: #282c34;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;border-radius: 6px;padding: 1em;\"><span style=\"color: #5c6370;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u62bd\u8c61\u88c5\u9970\u7c7b<\/span><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;IDecorate&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">interface<\/span>&nbsp;{<br  \/>&nbsp;Run()<br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;Decorate&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>&nbsp;Func&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span><span style=\"line-height: 26px;\">()<\/span><\/span><br  \/>&nbsp;decorateBefore&nbsp;[]IDecorate<br  \/>&nbsp;decorateAfter&nbsp;&nbsp;[]IDecorate<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*Decorate)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Before<\/span><span style=\"line-height: 26px;\">(decorate&nbsp;...IDecorate)<\/span><\/span>&nbsp;{<br  \/>&nbsp;d.decorateBefore&nbsp;=&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">append<\/span>(d.decorateBefore,&nbsp;decorate...)<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*Decorate)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">After<\/span><span style=\"line-height: 26px;\">(decorate&nbsp;...IDecorate)<\/span><\/span>&nbsp;{<br  \/>&nbsp;d.decorateAfter&nbsp;=&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">append<\/span>(d.decorateAfter,&nbsp;decorate...)<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*Decorate)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Run<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">for<\/span>&nbsp;_,&nbsp;decorateBefore&nbsp;:=&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">range<\/span>&nbsp;d.decorateBefore&nbsp;{<br  \/>&nbsp;&nbsp;decorateBefore.Run()<br  \/>&nbsp;}<br  \/>&nbsp;d.Func()<br  \/>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">for<\/span>&nbsp;_,&nbsp;decorateAfter&nbsp;:=&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">range<\/span>&nbsp;d.decorateAfter&nbsp;{<br  \/>&nbsp;&nbsp;decorateAfter.Run()<br  \/>&nbsp;}<br  \/>}<br  \/><br  \/><span style=\"color: #5c6370;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5177\u4f53\u88c5\u9970\u7c7b<\/span><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;ADecorate&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*ADecorate)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Run<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;fmt.Println(<span style=\"color: #98c379;line-height: 26px;\">\"\u6267\u884cA\"<\/span>)<br  \/>}<br  \/><br  \/><span style=\"color: #c678dd;line-height: 26px;\">type<\/span>&nbsp;BDecorate&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">struct<\/span>&nbsp;{<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"line-height: 26px;\">(d&nbsp;*BDecorate)<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">Run<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;fmt.Println(<span style=\"color: #98c379;line-height: 26px;\">\"\u6267\u884cB\"<\/span>)<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;a&nbsp;:=&nbsp;Decorate{Func:&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>&nbsp;{<br  \/>&nbsp;&nbsp;fmt.Println(<span style=\"color: #98c379;line-height: 26px;\">\"Hello\"<\/span>)<br  \/>&nbsp;}}<br  \/>&nbsp;a.Before(&amp;ADecorate{})<br  \/>&nbsp;a.Before(&amp;BDecorate{})<br  \/>&nbsp;a.After(&amp;ADecorate{})<br  \/>&nbsp;a.Run()<br  \/>}<br  \/><\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u88c5\u9970\u6a21\u5f0f\u4f18\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u88c5\u9970\u5668\u662f\u7ee7\u627f\u7684\u6709\u529b\u8865\u5145\uff0c\u6bd4\u7ee7\u627f\u7075\u6d3b\uff0c\u5728\u4e0d\u6539\u53d8\u539f\u6709\u5bf9\u8c61\u7684\u60c5\u51b5\u4e0b\uff0c\u52a8\u6001\u7684\u7ed9\u4e00\u4e2a\u5bf9\u8c61\u6269\u5c55\u529f\u80fd\uff0c\u5373\u63d2\u5373\u7528<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u901a\u8fc7\u4f7f\u7528\u4e0d\u7528\u88c5\u9970\u7c7b\u53ca\u8fd9\u4e9b\u88c5\u9970\u7c7b\u7684\u6392\u5217\u7ec4\u5408\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e0d\u540c\u6548\u679c<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u88c5\u9970\u5668\u6a21\u5f0f\u5b8c\u5168\u9075\u5b88\u5f00\u95ed\u539f\u5219<\/section>\n<\/li>\n<\/ol>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(90, 120, 131);font-size: 14px;font-weight: bold;margin-top: 0.5em;margin-bottom: 0.5em;\">? <span style=\"display: none;\"><\/span>\u88c5\u9970\u6a21\u5f0f\u7f3a\u70b9<span style=\"display: none;\"><\/span><\/h3>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u88c5\u9970\u5668\u6a21\u5f0f\u4f1a\u589e\u52a0\u8bb8\u591a\u5b50\u7c7b\uff0c\u8fc7\u5ea6\u4f7f\u7528\u4f1a\u589e\u52a0\u7a0b\u5e8f\u5f97\u590d\u6742\u6027<\/section>\n<\/li>\n<\/ol>\n<\/section>\n<p><br  \/><\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u8349\u8393\u6a59\u6c41\u513f              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\/ \u5173\u4e8eGolang\u9762\u8bd5\u5b9d\u5178\/ \u6700\u8fd1\u51e0\u5e74\uff0cGo\u7684\u70ed\u5ea6\u6301\u7eed\u98d9\u5347\uff0c\u56fd\u5185\u5916\u5f88\u591a\u5927\u516c\u53f8\u90fd\u5728\u5927\u89c4\u6a21\u7684\u4f7f\u7528Go\u3002Google\u662fGo\u8bed\u8a00\u8bde\u751f\u7684\u5730 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1671,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[23],"tags":[],"class_list":["post-1672","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-go"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528044351139-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528044351139-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528044351139-1024x435.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528044351139-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528044351139-1024x435.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528044351139.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Go","post_date":"2023-06-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":341,"next_post_id":5604,"next_post_title":"Go\u57fa\u7840\u7bc7-\u5305","previous_post_id":1701,"previous_post_title":"Golang\u9762\u8bd5\u5b9d\u5178\u2014\u2014Go\u8bed\u8a00\u57fa\u672c\u6570\u636e\u7c7b\u578b","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1672"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1672\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1671"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}