{"id":10008324,"date":"2023-09-25T19:54:36","date_gmt":"2023-09-25T11:54:36","guid":{"rendered":"https:\/\/blog.itmax.cn\/?p=10008324"},"modified":"2023-09-25T19:54:36","modified_gmt":"2023-09-25T11:54:36","slug":"%e5%bf%ab%e9%80%9f%e6%8e%8c%e6%8f%a1-go-%e5%b7%a5%e4%bd%9c%e5%8c%ba%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10008324","title":{"rendered":"\u5feb\u901f\u638c\u63e1 Go \u5de5\u4f5c\u533a\u6a21\u5f0f"},"content":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u714e\u9c7c\u3002<\/p>\n<p>\u5728 Go \u9879\u76ee\u7684\u6a21\u5757\u7ba1\u7406\u4e2d\uff0c\u5148\u662f GOPATH\uff0c\u7136\u540e\u5230\u5e9f\u5f03\u3002\u518d\u5230\u5f3a\u63a8 Go modules\uff0c\u4ece\u88ab\u793e\u533a\u6297\u62d2\u5230 rsc \u786c\u4e0a\u5f13\u3002\u73b0\u5728\u6700\u65b0\u8981\u4e86\u89e3\u7684\uff0c\u5c31\u662f\u5de5\u4f5c\u533a\u6a21\u5f0f\uff08workspace mode\uff09\u3002\u8fd9\u662f\u4e00\u4e2a\u5728 Go1.18 \u5f15\u5165\u7684\u91cd\u8981\u7279\u6027\u3002<\/p>\n<p>\u4e4b\u524d\u4e00\u76f4\u6ca1\u63d0\u8fc7\uff0c\u4eca\u5929\u8865\u5168\u8fd9\u5757\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<h2>\u80cc\u666f<\/h2>\n<p>\u5728 Go1.11 \u8d77\u6709\u4e86 Go modules \u540e\uff0c\u770b\u8d77\u6765 Go \u6a21\u5757\u7ba1\u7406\u9010\u6b65\u6309\u5e8f\u6709\u4e86\u7ea6\u675f\u3001\u89c4\u8303\u4e86\u8d77\u6765\u3002\u4f46\u4e5f\u5e26\u6765\u4e86\u4e00\u4e9b\u4f7f\u7528\u4e0a\u7684\u95ee\u9898\u3002<\/p>\n<p>\u73b0\u5b9e\u5f00\u53d1\u65f6\uff0c\u5f53\u6211\u4eec\u9700\u8981\u5bf9\u591a\u4e2a\u5173\u8054\u6a21\u5757\u8fdb\u884c\u5f00\u53d1\uff08\u4fee\u6539\uff09\u65f6\uff0c\u8fd9\u4e2a\u4e8b\u60c5\u5c31\u9ebb\u70e6\u4e86\u8d77\u6765\u3002\u6211\u89c1\u8fc7\u4e24\u79cd\u65b9\u5f0f\u3002<\/p>\n<p>1\u3001\u7b2c\u4e00\u79cd\uff1a\u76f4\u63a5\u5728 go.mod \u6587\u4ef6\u4e0a\u914d\u7f6e replace\uff0c\u914d\u7f6e\u5230\u672c\u5730\u7684\u5f00\u53d1\u76ee\u5f55\u3002\u8fd9\u662f\u6700\u5e38\u89c1\u7684\u65b9\u5f0f\u3002<\/p>\n<pre><code>\/\/ go.mod\n\nreplace example.com\/golang\/text =&gt; &quot;..\/eddycjy\/golang\/text&quot;<\/code><\/pre>\n<p>\u8fd9\u79cd\u505a\u6cd5\u7ecf\u5e38\u4f1a\u6709\u4eba\u4e0d\u5c0f\u5fc3\u63d0\u4ea4\u5230 Git \u4ed3\u5e93\u4e0a\u3002\u8fd8\u633a\u6298\u817e\u4eba\u7684\uff0c\u4e00\u4e2a\u4e0d\u5c0f\u5fc3\u5c31\u4e3a\u6b64 debug \u4e86\u534a\u5929\uff0c\u6216\u8005\u53d1\u5e03\u90e8\u7f72\u4e00\u76f4\u5361\u7740\u8fc7\u4e0d\u53bb\u3002<\/p>\n<p>2\u3001\u7b2c\u4e8c\u79cd\uff1a\u76f4\u63a5\u5728\u4f9d\u8d56\u6a21\u5757\u4e0a\u7f16\u7801\uff0c\u7f16\u7801\u5230\u4e00\u5b9a\u7684\u7a0b\u5ea6\u3002\u624d\u4e0a\u4f20 GitHub\/GitLab\u3002\u518d\u53bb\u53d1\u5e03\u7248\u672c\u6807\u7b7e\u518d\u5f15\u7528\u3002\u8fd9\u79cd\u7528\u6cd5\u6bd4\u8f83\u5c11\uff0c\u53ea\u6709\u6a21\u5757\u6bd4\u8f83\u7b80\u5355\u4e14\u5bf9\u7a0b\u5e8f\u6bd4\u8f83\u81ea\u4fe1\u7684\u4f1a\u8fd9\u4e48\u5e72\u3002\uff08\u4e0d\u63a8\u8350\uff09<\/p>\n<p>\u603b\u7684\u6765\u8bb2\uff0c\u5c31\u662f\u6709\u4e86 Go modules \u540e\uff0c\u591a\u6a21\u5757\u95f4\u7684\u4f9d\u8d56\u5f00\u53d1\u8fd8\u662f\u633a\u9ebb\u70e6\u7684\u3002\u8981\u7ecf\u5e38 replace\uff0c\u6709\u65f6\u5019\u53c8\u4f1a\u5fd8\u4e86\u5220\u3002<\/p>\n<h2>go work \u6307\u4ee4\u96c6<\/h2>\n<p>\u5728\u5927\u5bb6\u75db\u82e6\u4e86\u8bb8\u4e45\u540e\uff0cGo1.18 \u65f6\u7ec8\u4e8e\u53d1\u5e03\u4e86\u5de5\u4f5c\u533a\u6a21\u5f0f\u7684\u65b9\u5f0f\uff0c\u6765\u4f18\u5316\u8fd9\u4e2a\u7528\u6cd5\u548c\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f go work \u7684\u6307\u4ee4\u96c6\uff1a<\/p>\n<pre><code class=\"go\">go work &lt;command&gt; [arguments]<\/code><\/pre>\n<ul>\n<li>edit\uff1a\u4ece\u5de5\u5177\u6216\u811a\u672c\u4e2d\u7f16\u8f91 go.work\u3002<\/li>\n<li>init\uff1a\u521d\u59cb\u5316\u5de5\u4f5c\u533a\u6587\u4ef6\uff08go.work\uff09\u3002<\/li>\n<li>sync\uff1a\u5c06\u5de5\u4f5c\u533a\u6784\u5efa\u5217\u8868\u540c\u6b65\u5230\u6a21\u5757\u3002<\/li>\n<li>use\uff1a\u5c06\u6a21\u5757\u6dfb\u52a0\u5230\u5de5\u4f5c\u533a\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h2>\u5feb\u901f\u4f7f\u7528<\/h2>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u5feb\u901f\u5e94\u7528 Go \u5de5\u4f5c\u533a\u6a21\u5f0f\uff0c\u8ba9\u5927\u5bb6\u6709\u4e2a\u76f4\u89c2\u7684\u4e86\u89e3\u3002\u9700\u8981\u6ce8\u610f\uff0c\u8be5\u7279\u6027\u9700\u8981\u786e\u4fdd Go \u7248\u672c &gt;= 1.18\u3002<\/p>\n<h3>\u521b\u5efa\u5de5\u4f5c\u533a<\/h3>\n<p>\u9996\u5148\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u5de5\u4f5c\u533a\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>$ mkdir workspace-main &amp;&amp; cd workspace-main \n$ go work init<\/code><\/pre>\n<p>\u6267\u884c\u5b8c\u6bd5\u540e\u4f1a\u5728\u8be5\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a <code>go.work<\/code> \u6587\u4ef6\uff0c\u6587\u4ef6\u5185\u5bb9\u5305\u542b\uff1a<\/p>\n<pre><code>go 1.20<\/code><\/pre>\n<p>\u4ec5\u5305\u542b\u7248\u672c\u4fe1\u606f\uff0c\u56e0\u4e3a\u5f53\u524d\u662f\u7a7a\u767d\u7684\u5de5\u4f5c\u533a\uff0c\u53ea\u6709\u521d\u59cb\u5316\u884c\u4e3a\u3002<\/p>\n<h3>\u521b\u5efa\u6f14\u793a\u6a21\u5757<\/h3>\n<pre><code class=\"go\">$ mkdir hello-world &amp;&amp; cd hello-world\n$ go mod init example.com\/hello\ngo: creating new go.mod: module example.com\/hello<\/code><\/pre>\n<p>\u5199\u5165\u4ee3\u7801 hello.go\uff1a<\/p>\n<pre><code class=\"go\">package main\n\nimport (\n    &quot;fmt&quot;\n\n    &quot;golang.org\/x\/example\/hello\/reverse&quot;\n)\n\nfunc main() {\n    fmt.Println(reverse.String(&quot;Hello, \u714e\u9c7c&quot;))\n}<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u8fd9\u65f6\u5019\u76f4\u63a5 go run\u3002\u53ef\u80fd\u4f1a\u51fa\u73b0\u5982\u4e0b\u62a5\u9519\uff1a<\/p>\n<pre><code>hello.go:6:5: no required module provides package golang.org\/x\/example\/hello\/reverse: go.mod file not found in current directory or any parent directory; see 'go help modules'<\/code><\/pre>\n<p>\u770b\u7740\u975e\u5e38\u8ff7\u60d1\u4eba\uff0c\u5f88\u591a\u540c\u5b66\u4ee5\u4e3a\u662f\u73af\u5883\u53d8\u91cf <code>GO111MODULE<\/code> \u6ca1\u6709\u8bbe\u7f6e\u4e3a on\u3002\u5176\u5b9e\u662f\u6ca1\u6709\u5c06\u672c\u9879\u76ee\u52a0\u5165\u5de5\u4f5c\u533a\u4e2d\uff0c\u5bfc\u81f4\u8fd0\u884c\u9519\u8bef\u3002<\/p>\n<p>\u6240\u4ee5\u53ef\u4ee5\u770b\u51fa\u6765\uff0c\u5728\u8bbe\u8ba1\u4e0a\u662f\u5148\u6709\u9879\u76ee\uff0c\u518d\u6709\u5de5\u4f5c\u533a\u7684\u8def\u5f84\u3002\u4e5f\u662f\u76f8\u5bf9\u7b26\u5408\u7684\u3002<\/p>\n<p>\u8fd9\u65f6\u5019\u9700\u8981\u56de\u5230\u5de5\u4f5c\u533a\u76ee\u5f55 <code>workspace-main<\/code>\u3002\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>go work use .\/hello-world<\/code><\/pre>\n<p>go.work \u6587\u4ef6\u5185\u4f1a\u53d8\u6210\uff1a<\/p>\n<pre><code>$ cat go.work \ngo 1.20\n\nuse .\/hello-world<\/code><\/pre>\n<p>\u518d\u8fd0\u884c\u7a0b\u5e8f\uff1a<\/p>\n<pre><code>$ go run hello-world\/hello.go \n\u9c7c\u714e ,olleH<\/code><\/pre>\n<p>\u4e00\u5207\u6b63\u5e38\u3002<\/p>\n<h3>\u521b\u5efa\u9700\u4fee\u6539\u7684\u6a21\u5757<\/h3>\n<p>\u8fd9\u65f6\u5019\u6211\u4eec\u6709\u4e86\u4e00\u4e2a\u5b9e\u9645\u7684\u8bc9\u6c42\uff0c\u6211\u4eec\u5e0c\u671b <code>golang.org\/x\/example\/hello<\/code> \u6539\u4e00\u4e0b\u8fd9\u4e2a SDK \u5e93\u3002<\/p>\n<p>\u5982\u679c\u662f\u4ee5\u524d\u7684\u8bdd\uff0c\u6211\u4eec\u9700\u8981\u5199 replace \u6765\u89e3\u51b3\u3002\u73b0\u5728\u7684\u8bdd\u53ef\u4ee5\u7528\u5de5\u4f5c\u533a\u6a21\u5f0f\u6765\u5b8c\u6210\u8fd9\u4e2a\u8bc9\u6c42\u3002<\/p>\n<p>\u6211\u4eec\u5148\u9700\u8981\u56de\u5230\u5de5\u4f5c\u533a\u6839\u76ee\u5f55 <code>workspace-main<\/code> \u4e0b\uff0c\u62c9\u53d6\u8fd9\u4e2a SDK \u5e93\u5230\u5de5\u4f5c\u533a\u4e2d\uff1a<\/p>\n<pre><code>git clone https:\/\/go.googlesource.com\/example<\/code><\/pre>\n<p>\u518d\u5c06\u5176\u5f15\u5165\u9879\u76ee\u7684\u5de5\u4f5c\u533a\u4e2d\uff1a<\/p>\n<pre><code>go work use .\/example\/hello<\/code><\/pre>\n<p>go.work \u6587\u4ef6\u4f1a\u53d8\u6210\uff1a<\/p>\n<pre><code>go 1.20\n\nuse (\n    .\/example\/hello\n    .\/hello-world\n)<\/code><\/pre>\n<p>\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff0cgo work \u4ee5 go.mod \u4e3a\u5355\u4f4d\u3002\u5982\u679c\u4f60\u76f4\u63a5\u5f15\u5165 .\/example\u3002\u662f\u65e0\u6cd5\u5bf9 .\/example\/hello \u7684 module \u8d77\u6548\u679c\u7684\u3002<\/p>\n<p>\u5728\u5f15\u5165\u6210\u529f\u540e\uff0c\u6211\u4eec\u56de\u5230 .\/example\/hello \u76ee\u5f55\u4e0b\u7684 reverse.go \u6587\u4ef6\uff0c\u65b0\u589e\u4e00\u4e2a\u7528\u4e8e Demo \u7684\u65b9\u6cd5\uff1a<\/p>\n<pre><code>...\nfunc Hello() string {\n    return &quot;\u714e\u9c7c\uff0c\u4f60\u597d\uff01&quot;\n}<\/code><\/pre>\n<p>\u518d\u5230 hello \u9879\u76ee\u4e2d\uff0c\u65b0\u589e\u8c03\u7528\uff1a<\/p>\n<pre><code>package main\n\nimport (\n    &quot;fmt&quot;\n\n    &quot;golang.org\/x\/example\/hello\/reverse&quot;\n)\n\nfunc main() {\n    fmt.Println(reverse.String(&quot;Hello, \u714e\u9c7c&quot;))\n    fmt.Println(reverse.Hello())\n}<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<pre><code>\u9c7c\u714e ,olleH\n\u714e\u9c7c\uff0c\u4f60\u597d<\/code><\/pre>\n<p>\u4e00\u5207\u6b63\u5e38\u3002\u6ee1\u8db3\u4e0d\u6dfb\u52a0 replace \u7684\u8981\u6c42\uff0c\u4e5f\u4f7f\u7528\u4e86 go.work\uff0c\u4e0d\u7528\u62c5\u5fc3\u628a replace \u4e0d\u5c0f\u5fc3\u63d0\u4ea4\u5230 Git \u4ed3\u5e93\u4e2d\u3002<\/p>\n<p>\u53e6\u5916 Go \u5de5\u4f5c\u533a\u4e2d\u7684\u9879\u76ee\u5728\u8fdb\u884c\u7f16\u8bd1\u65f6\uff0c\u4e5f\u662f\u5f15\u7528\u6240\u914d\u7f6e\u597d\u7684\u5de5\u4f5c\u533a\u5185\u7684\u6a21\u5757\u3002\u800c\u4e0d\u662f\u5355\u5355\u53ea\u9488\u5bf9\u5f00\u53d1\u9636\u6bb5\u7684 go run\uff0c\u4e5f\u53ef\u4ee5\u5728\u4ea7\u7ebf\u4e0a\u53bb\u4f7f\u7528\uff0c\u7f16\u8bd1\u6210\u4e8c\u8fdb\u5236\u53bb\u5e94\u7528\u548c\u90e8\u7f72\u3002<\/p>\n<h2>\u573a\u666f\u6c47\u603b<\/h2>\n<p>\u6211\u4eec\u5df2\u7ecf\u5bf9 Go \u7684\u5de5\u4f5c\u533a\u6a21\u5f0f\u6709\u4e86\u4e00\u5b9a\u7684\u4e86\u89e3\uff0c\u5176\u4f7f\u7528\u573a\u666f\u805a\u7126\u5728\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u5f00\u53d1\u8f83\u5927\u7684\u4ea7\u54c1\uff0c\u5176\u9879\u76ee\u5b58\u5728\u7740\u591a\u4e2a\u4e92\u76f8\u4f9d\u8d56\u7684\u6a21\u5757\u3002\u53ef\u4ee5\u76f4\u63a5\u8bbe\u7f6e\u6210\u4e00\u4e2a\u5de5\u4f5c\u533a\u3002<\/li>\n<li>\u5f00\u53d1\u7b2c\u4e09\u65b9\u5e93\uff08\u7c7b\u4f3c SDK \u5e93\uff09\uff0c\u9700\u8981\u5bf9\u4e0a\u6e38\u7684\u6a21\u5757\u65b0\u589e\u65b0\u7279\u6027\u3002\u52bf\u5fc5\u8981\u5728\u672c\u5730\u6a21\u5757\u5148\u5f15\u7528\u505a\u5f00\u53d1\u3001\u6d4b\u8bd5\u3001\u9a8c\u8bc1\u3002\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5de5\u4f5c\u533a\u3002<\/li>\n<\/ul>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u4eca\u5929\u6211\u4eec\u5feb\u901f\u4e86\u89e3\u4e86 Go \u5de5\u4f5c\u533a\u6a21\u5f0f\uff08workspace mode\uff09\u7684\u80cc\u666f\u3001\u4f7f\u7528\u3001\u573a\u666f\u3002\u8fd9\u5bf9\u4e8e\u89e3\u51b3\u9879\u76ee\u4e2d\u591a\u6a21\u5757\u4f9d\u8d56\u6709\u7740\u4e00\u5b9a\u7684\u4f5c\u7528\uff0c\u53ef\u4ee5\u4e0d\u518d\u9700\u8981\u53bb go.mod \u91cc replace\uff0c\u7b97\u662f\u7ed9\u4e86\u4e00\u4e2a\u89c4\u8303\u5316\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5de5\u4f5c\u533a\u6a21\u5f0f\u7684\u4fbf\u5229\u5ea6\uff0c\u5176\u5b9e\u4e0d\u592a\u9ad8\u3002\u53ef\u80fd\u4f9d\u8d56\u6a21\u5757\u6570\u91cf\u5c11\u65f6\uff0c\u8fd8\u4e0d\u5982 replace \u4e00\u628a\u68ad\u6765\u5f97\u5feb\u3002<\/p>\n<p>\u53e6\u5916\u76ee\u524d\u9636\u6bb5\u7684\u4f7f\u7528\u5ba3\u4f20\u8fd8\u662f\u505a\u5f97\u6bd4\u8f83\u5f31\u7684\uff0c\u524d\u4e24\u5929\u95ee\u4e86\u4e00\u5708\uff0c\u8fd8\u771f\u6709\u4e00\u4e9b\u540c\u5b66\u4e0d\u77e5\u9053\uff0c\u4e5f\u6ca1\u6709\u7528\u8fc7\u7684\u3002<\/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=bFp3hnQS2Ha92W5c84bpng%3D%3D.NoxnaiF0tDwUHfnDU7IN%2BL3y58ohfCHChQz2S05shOg%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=6JkDIItlQUOiB7k1wYV3dg%3D%3D.%2BMnoWAqUa04uv87AvYN2ZyOwner0pNfXlaV9%2BsmN2mqSBm3P0Up4JMDNqapJH%2Frv\" rel=\"noopener noreferrer\">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 target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=Jpb082yWAWQT8BzTbEo4uQ%3D%3D.%2B8GrJAjAc%2BrfsrzSqzT90AC3pQkUWcS5jyANtKpHGSn1Yl5ekACig4zsX89e6HGD\" rel=\"noopener noreferrer\">Go \u8bed\u8a00\u5165\u95e8\u7cfb\u5217\uff1a\u521d\u63a2 Go \u9879\u76ee\u5b9e\u6218<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=hftDT2y1B99OayTEt2V09A%3D%3D.GSmHbgebfTbG%2BOhydy2%2BItyFgnq53acYBZ5rYk1oLTc%3D\" rel=\"noopener noreferrer\">Go \u8bed\u8a00\u7f16\u7a0b\u4e4b\u65c5\uff1a\u6df1\u5165\u7528 Go \u505a\u9879\u76ee<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=3ZAX%2FdjIfJKZWIlbfeJI2A%3D%3D.GV8QlQBU5HtszH8tB%2Bdx1YBetIWZgp9ZfEEPe7NWNaA%3D\" rel=\"noopener noreferrer\">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 target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=Fw8q2jt7OZmcmFDlscHr3Q%3D%3D.z4VROewdg6RfCdKiMyPaNg16WDQrYHFTlMYh%2FK8Q0JM%3D\" rel=\"noopener noreferrer\">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 target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=tqd%2F7uogBerKXBmeGHVxwA%3D%3D.socaDQvy%2FDHOvtkR%2BJ1L1DPukppcIdzvdgdNKNq4jFT1AzMydUU%2BwzCKgYEVuloN816V2UHC%2FJ9epD4dO320GA%3D%3D\" rel=\"noopener noreferrer\">Go \u5e38\u91cf\u4e3a\u4ec0\u4e48\u53ea\u652f\u6301\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff1f<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=%2BkEI0m9BktGYUbBDXa36%2BA%3D%3D.01laR76XFEpvLmAX521Ja8xeWk32aychdVI1lZPYErqxfjwNcgLxexUpDuSkw1RcL1%2FaWj5F67xFzr48wye6cA%3D%3D\" rel=\"noopener noreferrer\">\u4e92\u8054\u7f51\u516c\u53f8\u88c1\u5458\u7684\u9884\u5146\u548c\u624b\u6bb5<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=V51SXX8PTGv%2BMpa2N8UjJA%3D%3D.KUmCkWUcUvbxsid4DcOl0MevZMBAD1DKUqIzuGqlWYt%2Bk%2FWogP5OH0KKuORfOt2u1pVSYlYOXrplOB6KaGC3OA%3D%3D\" rel=\"noopener noreferrer\">Go1.21 \u90a3\u4e9b\u4e8b\uff1a\u6cdb\u578b\u5e93\u3001for \u8bed\u4e49\u53d8\u66f4\u3001\u7edf\u4e00 log\/slog\u3001WASI \u7b49\u65b0\u7279\u6027\uff0c\u4f60\u77e5\u9053\u591a\u5c11\uff1f<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000044257726\">https:\/\/segmentfault.com\/a\/1190000044257726<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u714e\u9c7c\u3002 \u5728 Go \u9879\u76ee\u7684\u6a21\u5757\u7ba1\u7406\u4e2d\uff0c\u5148\u662f GOPATH\uff0c\u7136\u540e\u5230\u5e9f\u5f03\u3002\u518d\u5230\u5f3a\u63a8 Go modules [&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-10008324","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\/10008324","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=10008324"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10008324\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10008324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10008324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10008324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}