{"id":10008383,"date":"2024-02-21T23:53:32","date_gmt":"2024-02-21T15:53:32","guid":{"rendered":"https:\/\/blog.itmax.cn\/?p=10008383"},"modified":"2024-02-21T23:53:32","modified_gmt":"2024-02-21T15:53:32","slug":"go-%e6%9b%b4%e5%bc%ba%e7%9a%84%e4%bb%a3%e7%a0%81%e6%b4%81%e7%99%96%ef%bc%8c%e5%8f%af%e4%bb%a5%e6%8a%8a-gofmt-%e7%bb%99%e6%8d%a2%e4%ba%86%ef%bc%81","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10008383","title":{"rendered":"Go \u66f4\u5f3a\u7684\u4ee3\u7801\u6d01\u7656\uff0c\u53ef\u4ee5\u628a gofmt \u7ed9\u6362\u4e86\uff01"},"content":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u714e\u9c7c\u3002<\/p>\n<p>\u6211\u4eec\u4ece\u4e00\u5f00\u59cb\u5199 Go \u4ee3\u7801\u548c\u5e94\u7528\uff0c\u5c31\u4f1a\u88ab\u5404\u79cd\u5b98\u65b9\u548c\u6c11\u95f4\u6559\u7a0b\uff0c\u751a\u81f3 IDE \u6559\u5bfc\u6211\u4eec\u5fc5\u987b\u914d\u4e00\u4e2a Gofmt \u5de5\u5177\u3002\u4ed6\u80fd\u591f\u683c\u5f0f\u5316 Go \u7a0b\u5e8f\u7684\u4ee3\u7801\u3002\u4f1a\u4f7f\u7528\u5236\u8868\u7b26\u8868\u793a\u7f29\u8fdb\uff0c\u7a7a\u767d\u8868\u793a\u5bf9\u9f50\u3002<\/p>\n<p>\u8fd9\u89e3\u51b3\u4e86\u7a0b\u5e8f\u5458\u5c4a\u7684\u8001\u5927\u96be\u95ee\u9898\u4e4b\u4e00\uff0c\u4ee3\u7801\u683c\u5f0f\u4e0a\u7684\u89c4\u8303\u95ee\u9898\u3002\u6709\u6548\u7684\u63d0\u9ad8\u4e86 Go \u4ee3\u7801\u7684\u9605\u8bfb\u7684\u53cb\u597d\u5ea6\u548c\u51cf\u5c11\u4e86\u540c\u4e8b\u95f4\u7684 <em>*<\/em>*\u3002\u975e\u5e38\u503c\u5f97\u8ba4\u53ef\u3002<\/p>\n<p>\u4f46\u6709\u65f6\u5019\uff0c\u8fd8\u662f\u4f1a\u770b\u5230\u4e00\u4e9b\u7cdf\u5fc3\u7684\u4ee3\u7801\uff0c\u603b\u4f1a\u89c9\u5f97 Gofmt\uff0c\u8fd8\u662f\u683c\u5f0f\u5316\u7684\u4e0d\u591f\u3002<\/p>\n<p>\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u6211\u53d1\u73b0\u7684\u4e00\u4e2a\u66f4\u72e0\u7684\u5de5\u5177\uff1agofumpt\uff0c\u4f8b\u5b50\u4e3b\u8981\u57fa\u4e8e\u5b98\u65b9\u6587\u6863\u3002<\/p>\n<h2>\u66f4\u5f3a\u7684\u683c\u5f0f\u5316\uff1agofumpt<\/h2>\n<p>Gofumpt \u4f1a\u6267\u884c\u6bd4 gofmt \u66f4\u4e25\u683c\u7684 Go \u683c\u5f0f\u89c4\u8303\u3002\u540c\u65f6\u786e\u4fdd\u5411\u540e\u517c\u5bb9\u3002<\/p>\n<p>\u8be5\u5de5\u5177\u662f Go 1.21 \u7684 gofmt \u5206\u652f\uff0c\u9700\u8981 Go 1.20 \u6216\u66f4\u9ad8\u7248\u672c\u3002\u5b83\u53ef\u4ee5\u76f4\u63a5\u66ff\u4ee3\u73b0\u6709\u7684 Go \u4ee3\u7801\u683c\u5f0f\u5316\uff0c\u4e5f\u5c31\u662f\u5728 gofumpt \u4e4b\u540e\u8fd0\u884c gofmt \u4e0d\u4f1a\u4ea7\u751f\u4efb\u4f55\u65b0\u7684\u53d8\u5316\u3002<\/p>\n<p>\u5b89\u88c5\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"shell\">$ go install mvdan.cc\/gofumpt@latest<\/code><\/pre>\n<p>\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"shell\">$ gofumpt -l -w .\nmain.go<\/code><\/pre>\n<p>\u518d\u67e5\u770b\u5bf9\u5e94\u88ab\u683c\u5f0f\u5316\u7684\u6587\u4ef6\u5c31\u5df2\u7ecf\u751f\u6548\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u66f4\u5177\u4f53\u7684 gofmt \u548c gofumpt \u7684\u533a\u522b\u4f8b\u5b50\u3002\u80fd\u591f\u5f88\u597d\u7684\u5e2e\u52a9\u5927\u5bb6\u8bc6\u522b\u5176\u4e2d\u7684\u5dee\u5f02\u3002<\/p>\n<h3>\u8d4b\u503c\u8fd0\u7b97\u7b26\u540e\u65e0\u7a7a\u884c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo() string {\n    foo :=\n        &quot;\u8111\u5b50\u8fdb\u714e\u9c7c\u4e86\uff01&quot;\n    return foo\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo() string {\n    foo := &quot;\u8111\u5b50\u8fdb\u714e\u9c7c\u4e86\uff01&quot;\n    return foo\n}<\/code><\/pre>\n<h3>\u51fd\u6570\u4f53\u5468\u56f4\u65e0\u7a7a\u884c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo() {\n\n    println(&quot;\u714e\u9c7c\u8fdb\u8111\u5b50\u4e86\uff01&quot;)\n\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo() {\n    println(&quot;\u714e\u9c7c\u8fdb\u8111\u5b50\u4e86\uff01&quot;)\n}<\/code><\/pre>\n<h3>\u51fd\u6570\u5e94\u5206\u9694 ) { \uff0c\u7f29\u8fdb\u6709\u52a9\u4e8e\u63d0\u9ad8\u53ef\u8bfb\u6027<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo(s string,\n    i int) {\n    println(&quot;\u714e\u9c7c\uff01\uff01\uff01&quot;)\n}\n\n\/\/ \u4f7f\u7528\u7a7a\u884c\u4f1a\u7a0d\u5fae\u597d\u4e00\u4e9b\uff0c\u4f46\u4ecd\u7136\u4e0d\u591f\u597d\nfunc bar(s string,\n    i int) {\n\n    println(&quot;\u714e\u9c7c\uff01\uff01\uff01&quot;)\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo(s string,\n    i int,\n) {\n    println(&quot;\u714e\u9c7c\uff01\uff01\uff01&quot;)\n}\n\nfunc bar(s string,\n    i int,\n) {\n    println(&quot;\u714e\u9c7c\uff01\uff01\uff01&quot;)\n}<\/code><\/pre>\n<h3>\u4ee3\u7801\u5757\u4e2d\u7684\u5355\u72ec\u8bed\u53e5\uff08\u6216\u6ce8\u91ca\uff09\u5468\u56f4\u6ca1\u6709\u7a7a\u884c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">if err != nil {\n\n    return err\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">if err != nil {\n    return err\n}<\/code><\/pre>\n<h3>\u7b80\u5355\u9519\u8bef\u68c0\u67e5\u524d\u65e0\u7a7a\u884c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">foo, err := processFoo()\n\nif err != nil {\n    return err\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">foo, err := processFoo()\nif err != nil {\n    return err\n}<\/code><\/pre>\n<h3>\u590d\u5408\u5b57\u9762\u91cf\u5e94\u7edf\u4e00\u4f7f\u7528\u6362\u884c\u7b26<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var ints = []int{1, 2,\n    3, 4}\n\nvar matrix = [][]int{\n    {1},\n    {2}, {\n        3,\n    },\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var ints = []int{\n    1, 2,\n    3, 4,\n}\n\nvar matrix = [][]int{\n    {1},\n    {2},\n    {\n        3,\n    },\n}<\/code><\/pre>\n<h3>\u7a7a\u5b57\u6bb5\u5217\u8868\u5e94\u4f7f\u7528\u5355\u884c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var V interface {\n} = 3\n\ntype T struct {\n}\n\nfunc F(\n)<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var V interface{} = 3\n\ntype T struct{}\n\nfunc F()<\/code><\/pre>\n<h3>\u6807\u51c6\u5e93\u5bfc\u5165\u5fc5\u987b\u5728\u9876\u90e8\u5355\u72ec\u5206\u7ec4<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">import (\n    &quot;foo.com\/bar&quot;\n\n    &quot;io&quot;\n\n    &quot;io\/ioutil&quot;\n)<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">import (\n    &quot;io&quot;\n    &quot;io\/ioutil&quot;\n\n    &quot;foo.com\/bar&quot;\n)<\/code><\/pre>\n<h3>\u77ed case \u5b50\u53e5\u5e94\u5360\u4e00\u884c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">switch c {\ncase 'a', 'b',\n    'c', 'd':\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">switch c {\ncase 'a', 'b', 'c', 'd':\n}<\/code><\/pre>\n<h3>\u591a\u884c\u9876\u5c42\u58f0\u660e\u5fc5\u987b\u7528\u7a7a\u884c\u9694\u5f00<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo() {\n    println(&quot;\u714e\u9c7c\uff01&quot;)\n}\nfunc bar() {\n    println(&quot;\u714e\u9c7c\uff01&quot;)\n}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">func foo() {\n    println(&quot;\u714e\u9c7c\uff01&quot;)\n}\n\nfunc bar() {\n    println(&quot;\u714e\u9c7c\uff01&quot;)\n}<\/code><\/pre>\n<h3>\u5355\u4e2a var \u58f0\u660e\u4e0d\u5e94\u4f7f\u7528\u62ec\u53f7\u5206\u7ec4<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var (\n    foo = &quot;\u714e\u9c7c\uff01&quot;\n)<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var foo = &quot;\u714e\u9c7c\uff01&quot;<\/code><\/pre>\n<h3>\u8fde\u7eed\u7684\u9876\u5c42\u58f0\u660e\u5e94\u5f52\u4e3a\u4e00\u7ec4<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var nicer = &quot;x&quot;\nvar with = &quot;y&quot;\nvar alignment = &quot;z&quot;<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var (\n    nicer     = &quot;x&quot;\n    with      = &quot;y&quot;\n    alignment = &quot;z&quot;\n)<\/code><\/pre>\n<h3>\u7b80\u5355\u7684 var \u58f0\u660e\u8bed\u53e5\u5e94\u4f7f\u7528\u77ed\u8d4b\u503c<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">var s = &quot;\u714e\u9c7c\u8fdb\u8111\u5b50\u4e86&quot;<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code>s := &quot;\u714e\u9c7c\u8fdb\u8111\u5b50\u4e86&quot;<\/code><\/pre>\n<p>\u9ed8\u8ba4\u542f\u7528 -s \u4ee3\u7801\u7b80\u5316\u6807\u8bb0\u3002<\/p>\n<h3>\u975e Go \u6307\u4ee4\u7684\u6ce8\u91ca\u5e94\u4ee5\u7a7a\u683c\u5f00\u5934<\/h3>\n<p>\u539f\u672c\u7531 gofmt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code>\/\/go:noinline\n\n\/\/Foo is awesome.\nfunc Foo() {}<\/code><\/pre>\n<p>\u6539\u4e3a gofumpt \u683c\u5f0f\u5316\u540e\uff1a<\/p>\n<pre><code class=\"go\">\/\/go:noinline\n\n\/\/ Foo is awesome.\nfunc Foo() {}<\/code><\/pre>\n<h2>VSCode \u914d\u7f6e<\/h2>\n<p>\u53ef\u4ee5\u76f4\u63a5\u5728 IDE \u4e2d\u8fdb\u884c\u914d\u7f6e\u3002\u4f8b\u5982 VSCode\uff0c\u53ef\u4ee5\u914d\u7f6e\u5bf9\u5e94\u7684 settings.json \u4e3a\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"json\">{\n    &quot;go.useLanguageServer&quot;: true,\n    &quot;gopls&quot;: {\n        &quot;formatting.gofumpt&quot;: true,\n    },\n}<\/code><\/pre>\n<p>\u5c31\u53ef\u4ee5\u76f4\u63a5\u5728 Go \u5e94\u7528\u4e2d\u7528\u8d77\u6765\u4e86\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u4e4b\u524d\u6211\u6709\u4e00\u4e2a\u670b\u53cb\uff0c\u63a5\u624b\u4e86\u4e00\u4e2a\u8001\u9879\u76ee\u3002\u90a3\u4f4d\u540c\u5b66\uff0c\u51e0\u4e4e\u6ca1\u6709\u4ec0\u4e48\u4ee3\u7801\u89c4\u8303\u7684\u98ce\u683c\u3002\u5168\u9760 gofmt \u6765\u5e2e\u4ed6\u683c\u5f0f\u5316\u3002<\/p>\n<p>\u4f46\u4f60\u4eec\u4e5f\u770b\u5230\uff0cgofmt \u53ea\u505a\u4e86\u6700\u57fa\u672c\u7684\u3002\u8fd9\u79cd\u65f6\u5019\u5982\u679c\u6709\u66f4\u4e25\u683c\u7684 Go \u4ee3\u7801\u683c\u5f0f\u5316\u5de5\u5177 gofumpt \u662f\u975e\u5e38\u4e0d\u9519\u7684\u3002\uff08\u4e5f\u9700\u8981\u5f15\u5bfc\u8fd9\u4f4d\u540c\u5b66\uff0c\u4f46\u5bb9\u6613\u6495\u903c\uff09<\/p>\n<p>\u50cf\u662f\u524d\u9762\u63d0\u5230\u7684 \u201c\u591a\u884c\u9876\u5c42\u58f0\u660e\u5fc5\u987b\u7528\u7a7a\u884c\u9694\u5f00\u201d \u662f\u975e\u5e38\u6709\u4ef7\u503c\u7684\u3002\u6211\u662f\u771f\u7684\u89c1\u8fc7\u4e00\u5927\u5768\u4e0d\u52a0\u7a7a\u884c\u90fd\u6324\u4e00\u8d77\u7684\u3002\u770b\u8d77\u6765\u975e\u5e38\u96be\u53d7\u3002<\/p>\n<p>\u5e0c\u671b\u8fd9\u4e2a\u66f4\u4e25\u683c\u7684 gofumpt\uff0c\u5bf9\u5927\u5bb6\u683c\u5f0f\u5316 Go \u4ee3\u7801\u80fd\u6709\u6240\u5e2e\u52a9\uff01<\/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 target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=MgqIli1RP6Lyd8Z8%2FeV8BQ%3D%3D.i2Af16vPU53edfm5MKhoJj0B2uyMt7%2FDQsVexF8rwsM%3D\" rel=\"noopener noreferrer\">github.com\/eddycjy\/blog<\/a> \u5df2\u6536\u5f55\uff0c\u5b66\u4e60 Go \u8bed\u8a00\u53ef\u4ee5\u770b <a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=vxMMM9s9Dvr0BK49EUqTQA%3D%3D.1jcRr7hwcKqSERyz1XXZApp0h2S0slGyCI9fopXVJaqvY0I1q7iTwasAqugG1PSO\" rel=\"noopener noreferrer\">Go \u5b66\u4e60\u5730\u56fe\u548c\u8def\u7ebf<\/a>\uff0c\u6b22\u8fce Star \u50ac\u66f4\u3002<\/p><\/blockquote>\n<h3>\u63a8\u8350\u9605\u8bfb<\/h3>\n<ul>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=yfoB2bkv6VH07eoxo7%2B2MA%3D%3D.bHl3Rnj5zXBJPmb0XiaWaGLF7gQs4KYtrDSd4OV27AegwhN%2FezfvcuSZ5JnTMdP1cXs6PFc33DC1C33e2%2F2kbw%3D%3D\" rel=\"noopener noreferrer\">Go1.22 \u65b0\u7279\u6027\uff1a\u589e\u5f3a http.ServerMux \u8def\u7531\u80fd\u529b\uff0c\u5c06\u6709\u66f4\u5f3a\u7684\u8868\u73b0\u529b\uff01<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=BRsCqXcSiHXgJ12LfzKF3w%3D%3D.IOKdp5DeT3xsXploJJUc3T5Ocv9Ufb6Ulqs6llvVsDiOFITxhOdfdcf5fQ%2F4zjUwdorm50BcmRezFXPPL10rHA%3D%3D\" rel=\"noopener noreferrer\">Go1.22 \u65b0\u7279\u6027\uff1afor \u5faa\u73af\u4e0d\u518d\u5171\u4eab\u5faa\u73af\u53d8\u91cf\uff0c\u4e14\u652f\u6301\u6574\u6570\u8303\u56f4<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=XcC7e%2F3ykFNUMXHLAG9N8A%3D%3D.NZLS1aU4vabP%2FhDoNCfNiK61tePpRfuUBzdWRqO%2FohEZLYYeAZWgDfRFFXifZpxwvmqM7GMAghRzhEmyjBoq0A%3D%3D\" rel=\"noopener noreferrer\">\u4e3a\u4ec0\u4e48 Go1.22 for \u5faa\u73af\u8981\u652f\u6301\u6574\u6570\u8303\u56f4\uff1f<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=2avF8JHnSxJHA7mAFZxFSA%3D%3D.famv7vQPd2n68CaCnoh0esIL4XIgFvt5nO7NsijW3knVPNNl0enf3VUh61LHLY7IhAcOzhTMWzkMMIm6Nw1kRg%3D%3D\" rel=\"noopener noreferrer\">Go1.22 \u65b0\u7279\u6027\uff1aSlices \u53d8\u66f4 Concat\u3001Delete\u3001Insert \u7b49\u51fd\u6570\uff0c\u5bf9\u5f00\u53d1\u633a\u6709\u5e2e\u52a9\uff01<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=fEcPDDgQyp%2FM8frQjVNc8A%3D%3D.sKIueJLcde%2BHv9KDmlTykwvcWqMUQsP8uMV5fu9ZkqF%2B5XHAc29%2Bpfm4BPZQ3fCg3QQyz%2FshRKV0TJTM5ZQCVw%3D%3D\" rel=\"noopener noreferrer\">Go1.22 \u65b0\u7279\u6027\uff1a\u65b0\u7684 math\/rand\/v2 \u5e93\uff0c\u66f4\u5feb\u66f4\u6807\u51c6\uff01<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000044645141\">https:\/\/segmentfault.com\/a\/1190000044645141<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u714e\u9c7c\u3002 \u6211\u4eec\u4ece\u4e00\u5f00\u59cb\u5199 Go \u4ee3\u7801\u548c\u5e94\u7528\uff0c\u5c31\u4f1a\u88ab\u5404\u79cd\u5b98\u65b9\u548c\u6c11\u95f4\u6559\u7a0b\uff0c\u751a\u81f3 IDE \u6559\u5bfc\u6211\u4eec\u5fc5\u987b\u914d\u4e00 [&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-10008383","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\/10008383","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=10008383"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10008383\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10008383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10008383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10008383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}