{"id":10006985,"date":"2022-12-16T22:19:23","date_gmt":"2022-12-16T14:19:23","guid":{"rendered":"https:\/\/ityet.com\/?p=10006985"},"modified":"2022-12-16T22:19:23","modified_gmt":"2022-12-16T14:19:23","slug":"%e5%b8%a6%e8%af%bb-%e3%80%8ago-in-action%e3%80%8b%e4%b8%ad%e6%96%87%ef%bc%9ago%e8%af%ad%e8%a8%80%e5%ae%9e%e6%88%98%e6%95%b0%e7%bb%84%e3%80%81%e5%88%87%e7%89%87%e3%80%81%e6%98%a0%e5%b0%84","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006985","title":{"rendered":"\u5e26\u8bfb |\u300aGo in Action\u300b(\u4e2d\u6587\uff1aGo\u8bed\u8a00\u5b9e\u6218)\u6570\u7ec4\u3001\u5207\u7247\u3001\u6620\u5c04"},"content":{"rendered":"<h2>\u6570\u7ec4<\/h2>\n<h3>\u96f6\u503c\u6570\u7ec4\u58f0\u660e<\/h3>\n<p><code>var arr [5]int<\/code><\/p>\n<h3>\u5b57\u9762\u91cf\u6570\u7ec4\u58f0\u660e<\/h3>\n<p><code>arr := [5]int{1,2,3,4,5}<\/code><\/p>\n<h3>\u4e09\u4e2a\u70b9\u81ea\u52a8\u8ba1\u7b97\u6570\u7ec4\u957f\u5ea6<\/h3>\n<p><code>arr := [...]int{1,2,3,4,5}<\/code><\/p>\n<hr>\n<h2>\u5207\u7247<\/h2>\n<h3>\u58f0\u660e\u957f\u5ea6\u548c\u5bb9\u91cf\u76f8\u7b49\u7684\u5207\u7247<\/h3>\n<p><code>slice := make([]string, 6)<\/code><\/p>\n<h3>\u58f0\u660e\u957f\u5ea6\u548c\u5bb9\u91cf\u4e0d\u7b49\u7684\u5207\u7247<\/h3>\n<p><code>slice := make([]string, 3,6)<\/code><\/p>\n<h3>\u5b57\u9762\u91cf\u58f0\u660e\u5207\u7247<\/h3>\n<p><code>slice := []int {1, 2, 3)<\/code><\/p>\n<h3>\u7d22\u5f15\u58f0\u660e\u5207\u7247<\/h3>\n<p><code>slice := []string{99,&quot;&quot;}<\/code><\/p>\n<h3>nil\u5207\u7247<\/h3>\n<p><code>var slice []int<\/code><\/p>\n<h3>\u7a7a\u5207\u7247<\/h3>\n<pre><code>slice := make([]int, 0)\n\u6216\u8005\nslice := []int{}<\/code><\/pre>\n<p>\u672a\u5b8c\u5f85\u7eed\u3002\u3002<\/p>\n<hr>\n<blockquote><p>\u53c2\u8003\uff1aKennedy W ,  Ketelsen B ,  Martin E S . Go in action.  2016.<\/p><\/blockquote>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc4VJk\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043099631\">https:\/\/segmentfault.com\/a\/1190000043099631<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6570\u7ec4 \u96f6\u503c\u6570\u7ec4\u58f0\u660e var arr [5]int \u5b57\u9762\u91cf\u6570\u7ec4\u58f0\u660e arr := [5]int{1,2,3,4, [&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-10006985","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\/10006985","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=10006985"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006985\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}