{"id":10006962,"date":"2022-12-14T17:05:15","date_gmt":"2022-12-14T09:05:15","guid":{"rendered":"https:\/\/ityet.com\/?p=10006962"},"modified":"2022-12-14T17:05:15","modified_gmt":"2022-12-14T09:05:15","slug":"%e5%a4%9a%e4%b8%aa%e8%91%97%e5%90%8d-go-%e5%bc%80%e6%ba%90%e9%a1%b9%e7%9b%ae%e8%a2%ab%e6%94%be%e5%bc%83%ef%bc%8c%e5%81%9a%e5%a4%a7%e5%bc%80%e6%ba%90%e4%b8%8d%e8%83%bd%e7%94%a8%e7%88%b1%e5%8f%91","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006962","title":{"rendered":"\u591a\u4e2a\u8457\u540d Go \u5f00\u6e90\u9879\u76ee\u88ab\u653e\u5f03\uff0c\u505a\u5927\u5f00\u6e90\u4e0d\u80fd\u7528\u7231\u53d1\u7535\uff0c\u66f4\u4e0d\u80fd\u53ea\u9760\u81ea\u5df1\uff01"},"content":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u714e\u9c7c\u3002<\/p>\n<p>\u76f8\u4fe1\u5173\u6ce8\u6211\u7684\u8bb8\u591a\u540c\u5b66\u90fd\u6709\u63a5\u89e6 Go \u8bed\u8a00\u7684\u5f00\u53d1\uff0c\u751a\u81f3\u5728\u4f01\u4e1a\u4e2d\u591a\u6709\u5b9e\u8df5\u3002\u90a3\u4e48\u4f60\u5728\u65e5\u5e38\u5f00\u53d1\u4e2d\uff0c\u52bf\u5fc5\u4f1a\u63a5\u89e6\u5230 <a href=\"https:\/\/link.segmentfault.com\/?enc=O%2FJQ07UKq9PKDzMV7up%2BCg%3D%3D.HdacDxRmxL%2Bx958KRP3vA84eFKyTg%2BrsYlvjIofQp08%3D\" rel=\"nofollow\" title=\"gorilla\">gorilla<\/a> \u7ec4\u7ec7\u4e0b\u7684\u5404\u4e2a Go \u5f00\u6e90\u9879\u76ee\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043037658\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043037659\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<ul>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=pw7Cjn1PGlMs2mvBpnTWxQ%3D%3D.CUu2NQ6RT%2BrIJyVQU7bPzrjCEIjglw7bZ3%2FKtkbMt%2Fg%3D\" rel=\"nofollow\" title=\"gorilla\/mux\">gorilla\/mux<\/a>\uff1aStar\uff1a17.9k\u3002a powerful request router for web applications\u3002<\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=cZC22DQd9QNZ62iWjHFGeA%3D%3D.3RqbK4otW4BqtHZL2AA98OOw%2FI1oWh6YZwV1M9kmimLf0SQvVcpceD4KvoKz37pa\" rel=\"nofollow\" title=\"gorilla\/websocket\">gorilla\/websocket<\/a>\uff1aStar\uff1a18.6k\u3002a standards-compliant and widely used websocket library\u3002<\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=A64QtWvJ6SYd8BCYj1Oy9w%3D%3D.J6xLWz0cPmw68sTnToB0VRnFgXdyY4Z4JNQZdOgTwwXwKsNex1aGrzRYiEIY7yRA\" rel=\"nofollow\" title=\"gorilla\/sessions\">gorilla\/sessions<\/a>\uff1aStar\uff1a2.5k\u3002making cookies and session management easy\u3002<\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=yrRzpV8gdjFdOHPMMVaZgQ%3D%3D.K2eR7pJCU7QaW2sI50krGAOn4JiGj%2BXh37su4vOfIM%2FRal27etD9ks7jxB3yGfBp\" rel=\"nofollow\" title=\"gorilla\/handlers\">gorilla\/handlers<\/a>\uff1aStar\uff1a1.5k\u3002a collection of useful middleware for Go HTTP applications\u3002<\/li>\n<\/ul>\n<p>\u5c24\u5176\u662f gorilla\/mux \u548c gorilla\/websocket \u662f\u5f88\u591a\u4eba\u9996\u9009\u63a8\u8350\u7684\u9879\u76ee\uff0c\u5728\u5404\u8f6f\u4ef6\u5e93\u7684\u5e95\u5c42\u4f5c\u4e3a\u57fa\u7840\u5f97\u5230\u5927\u8303\u56f4\u7684\u5f15\u7528\u3002\u751a\u81f3\u5728 grpc \u7684\u5b9e\u8df5\u4e2d\uff0chttp\/1.1 \u548c grpc \u548c tcp \u540c\u7aef\u53e3\u63d0\u4f9b\u670d\u52a1\u4e0a\uff0cgorilla\/mux \u4e5f\u63d0\u4f9b\u4e86\u8bb8\u591a\u5b9e\u8df5\uff0c\u5f15\u9886\u4e86\u5927\u5bb6\u8fdb\u6b65\u3002<\/p>\n<p>\u5c31\u5728\u8fd9\u4e24\u5929\uff0cgorilla \u7ec4\u7ec7\u7684\u7ef4\u62a4\u8005 @Matt Silverlock \u6b63\u5f0f\u5ba3\u5e03\uff1a<strong>\u5728 2022 \u5e74\u5e95\uff0c\u5c06\u4f1a\u628a Gorilla \u9879\u76ee\u4e0b\u7684\u4ed3\u5e93\u8bbe\u7f6e\u4e3a \u201carchive mode\u201d\u3002\u4e5f\u5c31\u662f\u4e0d\u518d\u7ef4\u62a4\u4e86<\/strong>\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u8fd9\u4e2a\u7ec4\u7ec7\u7684\u4e00\u4e9b\u5386\u53f2\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043037660\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u539f\u59cb\u4f5c\u8005 @<br \/>rodrigo moraes \u5728 2013 \u5e74\u5c31\u9000\u51fa\u4e86\uff0c2014 \u5e74\u73b0\u4efb\u4f5c\u8005 @Matt Silverlock \u5f00\u59cb\u53c2\u4e0e\u3002<br \/>\u5728 2021 \u5e74\u8d77\u5bfb\u627e\u7ee7\u627f\u8005\uff08\u4e2a\u4eba\u6216\u516c\u53f8\uff09\uff0c\u6ca1\u6709\u627e\u5230\u5408\u9002\u7684\u3002<\/p>\n<p>\u51b3\u5b9a\u5728 2022 \u5e74\u5e95\u6b63\u5f0f\u7ed3\u675f\u8fd9\u957f\u8fbe 8 \u5e74\u7684\u7ef4\u62a4\uff0c\u5c06 gorilla \u9879\u76ee\u7ed3\u675f\u7ef4\u62a4\u3002<\/p>\n<p>\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u4e0d\u518d\u7ef4\u62a4\u4e86\u5462\uff1f\u4f5c\u8005\u4e5f\u59d4\u5a49\u7684\u900f\u9732\u4e86\u4ee5\u4e0b\u51e0\u4e2a\u539f\u56e0\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043037661\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<ul>\n<li>\u6700\u57fa\u672c\u7684<strong>\u8fde\u5bf9\u95ee\u9898\u8fdb\u884c\u5206\u7c7b\u7684\u79ef\u6781\u8d21\u732e\u8005\u90fd\u6ca1\u6709<\/strong>\u3002\u867d\u7136\u6709\u5f88\u591a\u4eba\u8868\u793a\u613f\u610f\u53c2\u4e0e\u7ef4\u62a4\uff0c\u4f46\u5728\u4ed6\u4eec\u4e3e\u8d77\u624b\u540e\uff08\u5728 issues \u4e2d\u53d1\u8868\u8bc4\u8bba\u613f\u610f\uff09\uff0c\u518d\u4e5f\u6ca1\u6709\u51fa\u73b0\u8fc7\u3002<\/li>\n<li>2018 \u5e74\u5de6\u53f3\u5f00\u59cb\uff0c\u73b0\u4efb\u4f5c\u8005 @Matt Silverlock \u51e0\u4e4e\u662f\u6240\u6709\u9879\u76ee\uff08\u9664 websocket\uff09\u7684<strong>\u552f\u4e00\u7ef4\u62a4\u8005<\/strong>\u3002\u8a00\u8bed\u4e2d\u611f\u89c9\u4ed6\u4e5f\u7d2f\u4e86\uff0c\u4f3c\u4e4e\u5c31\u50cf\u4e00\u4e2a\u4eba\u5728\u63a8\u4e00\u8f86\u5de8\u5927\u7684\u706b\u8f66\uff08\u714e\u9c7c\u6ce8\uff09\u3002<\/li>\n<li>\u73b0\u4efb\u4f5c\u8005<strong>\u5e0c\u671b\u63a2\u7d22\u5176\u4ed6\u65b9\u9762<\/strong>\uff0c\u4ed6\u4e2a\u4eba\u65f6\u95f4\u73b0\u5728\u975e\u5e38\u4e5f\u6709\u9650\uff0c\u82b1\u4e86 1 \u5e74\u4e5f\u6ca1\u6709\u627e\u5230\u5408\u9002\u7684\u7ef4\u62a4\u8005\u3002<\/li>\n<\/ul>\n<p>\u7ed3\u5408\u73b0\u4efb\u4f5c\u8005\u5728\u627e\u65b0\u7ef4\u62a4\u8005\u548c\u793e\u533a\u7684\u4ea4\u6d41\u8fc7\u7a0b\u4e2d\uff0c\u867d\u7136\u4e5f\u6709\u4eba\u629b\u51fa\u91d1\u94b1\u4f5c\u4e3a\u7ef4\u62a4\u7684\u6a44\u6984\u679d\u3002\u4f46\u4f3c\u4e4e\u4f5c\u8005\u5df2\u7ecf\u75b2\u4e86&#8230;<\/p>\n<p>\u53ef\u4ee5\u53d1\u73b0\u5728\u4efb\u4f55\u9879\u76ee\u5927\u4e86\u540e\uff0c\u90fd\u9700\u8981\u66f4\u591a\u7684\u56e2\u961f\uff08\u4eba\uff09\u3001\u65f6\u95f4\u3001\u91d1\u94b1\u6765\u53c2\u4e0e\u7ef4\u62a4\u548c\u8fed\u4ee3 gorilla \u7ec4\u7ec7\u4e0b\u7684\u76f8\u5173\u9879\u76ee\u3002\u5426\u5219\u662f\u5f88\u96be\u6301\u7eed\u957f\u4e45\u7684\u3002\u8fd9\u4e48\u6765\u770b\uff0c\u53ef\u80fd\u4e5f\u8be5\u5e86\u5e78 Go \u81ea\u8eab\u4e0d\u662f\u4e00\u4e2a\u7eaf\u7684\u7528\u7231\u53d1\u7535\u7684\u9879\u76ee\uff1f\u6bd5\u7adf Google \u53d1\u5de5\u8d44\u548c\u62db\u4eba\u3002<\/p>\n<p>\u65e0\u8bba\u4efb\u4f55\uff0c\u7ef4\u62a4\u4e00\u4e2a\u5e9e\u5927\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u4e0d\u80fd\u5355\u5355\u53ea\u9760\u6280\u672f\u89d2\u5ea6\u53bb\u8bbe\u8ba1\u9879\u76ee\u548c\u56e2\u961f\u3002\u5c31\u50cf\u56fd\u5185\u8bb8\u591a\u6570\u636e\u5e93\u9879\u76ee\uff0c\u6700\u540e\u90fd\u4f1a\u8d70\u51fa\u6765\uff0c\u6210\u4e3a\u4e00\u5bb6\u516c\u53f8\uff0c\u5b9e\u73b0\u4e13\u4eba\u4e13\u804c\u3002<\/p>\n<p>\u611f\u8c22\u5927\u4f6c\u7684\u8d21\u732e\u3002\u4eba\u751f\u6709\u591a\u5c11\u4e2a 8 \u5e74\uff1f<\/p>\n<blockquote><p>\u6587\u7ae0\u6301\u7eed\u66f4\u65b0\uff0c\u53ef\u4ee5\u5fae\u4fe1\u641c\u3010\u8111\u5b50\u8fdb\u714e\u9c7c\u4e86\u3011\u9605\u8bfb\uff0c\u672c\u6587 <strong>GitHub<\/strong> <a href=\"https:\/\/link.segmentfault.com\/?enc=v0%2Ftib0oU5%2FMG%2FyeX6z%2FSA%3D%3D.0v2hNdjQyVFvk2dBg9m5CK7qgOsFqUXxJnvIp3X5ATE%3D\" rel=\"nofollow\">github.com\/eddycjy\/blog<\/a> \u5df2\u6536\u5f55\uff0c\u5b66\u4e60 Go \u8bed\u8a00\u53ef\u4ee5\u770b <a href=\"https:\/\/link.segmentfault.com\/?enc=mdrugfNTaqhdO3KdF%2BwlMQ%3D%3D.BI1utXBDEYQnhQP2fuEE5LZZuAHsq8dt3XXoTNJXG9Irg%2F2EvegD5Vt1XBl2%2BSDT\" rel=\"nofollow\">Go \u5b66\u4e60\u5730\u56fe\u548c\u8def\u7ebf<\/a>\uff0c\u6b22\u8fce Star \u50ac\u66f4\u3002<\/p><\/blockquote>\n<h3>Go \u56fe\u4e66\u7cfb\u5217<\/h3>\n<ul>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=rHWB%2FSKtzH5PL4HB86Y07Q%3D%3D.6pivM6nj1tGvVXkVT8ekZrQJGk8m9btoH6%2FaBt%2Fky1UcBV5ezca4tPQCYXXLAxz%2F\" rel=\"nofollow\">Go \u8bed\u8a00\u5165\u95e8\u7cfb\u5217\uff1a\u521d\u63a2 Go \u9879\u76ee\u5b9e\u6218<\/a><\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=fJSd4HYF%2BY90E2kz7pPDKQ%3D%3D.X1eSwnZG%2FE0HWnlIqpN1VZCWlKwFyl%2BnB0OgpMs8vpM%3D\" rel=\"nofollow\">Go \u8bed\u8a00\u7f16\u7a0b\u4e4b\u65c5\uff1a\u6df1\u5165\u7528 Go \u505a\u9879\u76ee<\/a><\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=lPi%2BFojU%2F%2BM5vrG359ZG9g%3D%3D.%2FKjmNHM5tCkK4QUrGQlJMYLQ%2Fyiyy%2Fj9sGcl83EstCU%3D\" rel=\"nofollow\">Go \u8bed\u8a00\u8bbe\u8ba1\u54f2\u5b66\uff1a\u4e86\u89e3 Go \u7684\u4e3a\u4ec0\u4e48\u548c\u8bbe\u8ba1\u601d\u8003<\/a><\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=iyKnC02o0OX6zPUNddIyRw%3D%3D.%2FfdZxY4xgmKlkrNnB%2BAE%2F4kCJEFW5SHmAaflUS9OX%2BI%3D\" rel=\"nofollow\">Go \u8bed\u8a00\u8fdb\u9636\u4e4b\u65c5\uff1a\u8fdb\u4e00\u6b65\u6df1\u5165 Go \u6e90\u7801<\/a><\/li>\n<\/ul>\n<h4>\u63a8\u8350\u9605\u8bfb<\/h4>\n<ul>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=L4qSzwAwSNh4phV9ovArxQ%3D%3D.9kApmiKVYMosgx89d7SWgi0jabIP%2FJehQQILeewUAlwfa%2F%2FG%2FrsBxCXa49e5OsmrVmMmJyR7HIKz8pJEg24cKQ%3D%3D\" rel=\"nofollow\">Go1.20 \u4e2d\u4e24\u4e2a\u5173\u4e8e Time \u7684\u66f4\u65b0\uff0c\u7ec8\u4e8e\u4e0d\u7528\u80cc 2006-01-02 15:04:05 \u4e86\uff01<\/a><\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=RcX9NdynFa1xSxlReQzREQ%3D%3D.NgrAJMY1mHFxaL9Pe%2BljhY%2F0Rp%2FC5kgICHrWDEBPsf%2BMJuWC50zFc9mrr3laZzihdXHXcLmLEpQegOEzfohIBQ%3D%3D\" rel=\"nofollow\">\u6253\u8138\u4e86\u5144\u5f1f\u4eec\uff0cGo1.20 arena \u6765\u4e86\uff01<\/a><\/li>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=dz78yk7SFl54C6368uoPeg%3D%3D.2I8lKZU4pE%2BC5a%2Bu6%2BEnPjC77cXW8h6RfYetyMHj82qv1hZqaGlRpnLDYrqqNjl5inBNU0%2Bu4XPmCcbx%2FOsxMQ%3D%3D\" rel=\"nofollow\">Go \u5341\u5e74\u4e86\uff0c\u7ec8\u4e8e\u60f3\u8d77\u8981\u7edf\u4e00 log \u5e93\u4e86\uff01<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043037656\">https:\/\/segmentfault.com\/a\/1190000043037656<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u714e\u9c7c\u3002 \u76f8\u4fe1\u5173\u6ce8\u6211\u7684\u8bb8\u591a\u540c\u5b66\u90fd\u6709\u63a5\u89e6 Go \u8bed\u8a00\u7684\u5f00\u53d1\uff0c\u751a\u81f3\u5728\u4f01\u4e1a\u4e2d\u591a\u6709\u5b9e\u8df5\u3002\u90a3\u4e48\u4f60\u5728\u65e5\u5e38\u5f00\u53d1\u4e2d\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10006962","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006962"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006962\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}