{"id":1439,"date":"2025-02-08T23:50:32","date_gmt":"2025-02-08T15:50:32","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=1439"},"modified":"2025-02-08T23:50:33","modified_gmt":"2025-02-08T15:50:33","slug":"go%e8%af%ad%e8%a8%80%e6%a0%87%e5%87%86%e5%ba%93%e4%b8%8e%e5%b8%b8%e7%94%a8%e5%b7%a5%e5%85%b7%ef%bc%9a%e6%96%87%e4%bb%b6%e6%93%8d%e4%bd%9c%e3%80%81json%e5%a4%84%e7%90%86%e4%b8%8e%e5%ad%97%e7%ac%a6","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/02\/08\/go%e8%af%ad%e8%a8%80%e6%a0%87%e5%87%86%e5%ba%93%e4%b8%8e%e5%b8%b8%e7%94%a8%e5%b7%a5%e5%85%b7%ef%bc%9a%e6%96%87%e4%bb%b6%e6%93%8d%e4%bd%9c%e3%80%81json%e5%a4%84%e7%90%86%e4%b8%8e%e5%ad%97%e7%ac%a6\/","title":{"rendered":"Go\u8bed\u8a00\u6807\u51c6\u5e93\u4e0e\u5e38\u7528\u5de5\u5177\uff1a\u6587\u4ef6\u64cd\u4f5c\u3001JSON\u5904\u7406\u4e0e\u5b57\u7b26\u4e32\u51fd\u6570"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u7684\u6807\u51c6\u5e93\u662f\u5176\u5f3a\u5927\u751f\u6001\u7cfb\u7edf\u7684\u6838\u5fc3\uff0c\u63d0\u4f9b\u4e86\u4f17\u591a\u7528\u4e8e\u5e38\u89c1\u5f00\u53d1\u4efb\u52a1\u7684\u5de5\u5177\uff0c\u5305\u62ecI\/O\u64cd\u4f5c\u3001\u7f51\u7edc\u7f16\u7a0b\u3001\u5b57\u7b26\u4e32\u5904\u7406\u3001\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u3001JSON\u5e8f\u5217\u5316\u3001\u4ee5\u53ca\u6d4b\u8bd5\u4e0e\u8c03\u8bd5\u5de5\u5177\u7b49\u3002\u719f\u6089\u8fd9\u4e9b\u6807\u51c6\u5e93\u548c\u5de5\u5177\u5c06\u5927\u5927\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5.1 <strong>I\/O\u64cd\u4f5c<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684I\/O\u5e93\uff0c\u7528\u4e8e\u5904\u7406\u6587\u4ef6\u64cd\u4f5c\u3001\u7f51\u7edc\u901a\u4fe1\u7b49\u5e38\u89c1\u4efb\u52a1\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.1.1 <strong>\u6587\u4ef6\u64cd\u4f5c\uff08os\u3001io\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u901a\u8fc7<code>os<\/code>\u548c<code>io<\/code>\u5305\u6765\u6267\u884c\u6587\u4ef6\u8bfb\u53d6\u3001\u5199\u5165\u548c\u5176\u4ed6\u5e38\u89c1\u7684\u6587\u4ef6\u64cd\u4f5c\u3002<code>os<\/code>\u5305\u63d0\u4f9b\u4e86\u64cd\u4f5c\u6587\u4ef6\u7cfb\u7edf\u7684\u529f\u80fd\uff0c\u5982\u6587\u4ef6\u521b\u5efa\u3001\u5220\u9664\u3001\u91cd\u547d\u540d\u7b49\u3002<code>io<\/code>\u5305\u5219\u5305\u542b\u4e86\u6d41\u5f0fI\/O\u64cd\u4f5c\u7684\u76f8\u5173\u529f\u80fd\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u6587\u4ef6\u8bfb\u53d6<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"os\"\n)\n\nfunc main() {\n    \/\/ \u6253\u5f00\u6587\u4ef6\n    file, err := os.Open(\"example.txt\")\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    defer file.Close()\n\n    \/\/ \u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\n    buffer := make(&#91;]byte, 100)\n    _, err = file.Read(buffer)\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(\"File content:\", string(buffer))\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u6587\u4ef6\u5199\u5165<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"os\"\n)\n\nfunc main() {\n    file, err := os.Create(\"output.txt\")\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    defer file.Close()\n\n    _, err = file.WriteString(\"Hello, Golang!\")\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(\"File written successfully\")\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5.1.2 <strong>\u7f51\u7edc\u7f16\u7a0b\uff08net\u3001http\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u7684<code>net<\/code>\u5305\u63d0\u4f9b\u4e86\u7f51\u7edc\u901a\u4fe1\u7684\u5e95\u5c42\u529f\u80fd\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u521b\u5efa\u548c\u7ba1\u7406TCP\/UDP\u8fde\u63a5\u3002\u800c<code>http<\/code>\u5305\u5219\u7528\u4e8e\u5b9e\u73b0HTTP\u534f\u8bae\uff0c\u652f\u6301\u6784\u5efaWeb\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1aTCP\u670d\u52a1\u5668<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"net\"\n    \"os\"\n)\n\nfunc main() {\n    listener, err := net.Listen(\"tcp\", \":8080\")\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        os.Exit(1)\n    }\n    defer listener.Close()\n\n    fmt.Println(\"Listening on port 8080...\")\n    for {\n        conn, err := listener.Accept()\n        if err != nil {\n            fmt.Println(\"Error:\", err)\n            continue\n        }\n        go handleRequest(conn)\n    }\n}\n\nfunc handleRequest(conn net.Conn) {\n    fmt.Println(\"Connection established\")\n    conn.Write(&#91;]byte(\"Hello, TCP Client\"))\n    conn.Close()\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1aHTTP\u670d\u52a1\u5668<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"net\/http\"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n    fmt.Fprintf(w, \"Hello, HTTP!\")\n}\n\nfunc main() {\n    http.HandleFunc(\"\/\", handler)\n    fmt.Println(\"Starting server at :8080\")\n    http.ListenAndServe(\":8080\", nil)\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5.2 <strong>\u5b57\u7b26\u4e32\u5904\u7406<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u901a\u8fc7<code>strings<\/code>\u5305\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5b57\u7b26\u4e32\u5904\u7406\u529f\u80fd\uff0c\u5305\u62ec\u5b57\u7b26\u4e32\u7684\u67e5\u627e\u3001\u66ff\u6362\u3001\u5207\u5272\u7b49\u5e38\u89c1\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.2.1 <strong>\u5b57\u7b26\u4e32\u76f8\u5173\u51fd\u6570\uff08strings\u5305\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>strings<\/code>\u5305\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5e38\u7528\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570\uff0c\u4f8b\u5982<code>Contains<\/code>\u3001<code>Index<\/code>\u3001<code>Replace<\/code>\u7b49\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u5b57\u7b26\u4e32\u67e5\u627e\u548c\u66ff\u6362<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"strings\"\n)\n\nfunc main() {\n    str := \"Hello, Go!\"\n\n    \/\/ \u67e5\u627e\u5b50\u4e32\u662f\u5426\u5b58\u5728\n    fmt.Println(strings.Contains(str, \"Go\"))  \/\/ \u8f93\u51fa: true\n\n    \/\/ \u67e5\u627e\u5b50\u4e32\u7684\u7d22\u5f15\u4f4d\u7f6e\n    fmt.Println(strings.Index(str, \"Go\"))  \/\/ \u8f93\u51fa: 7\n\n    \/\/ \u66ff\u6362\u5b50\u4e32\n    newStr := strings.Replace(str, \"Go\", \"Golang\", 1)\n    fmt.Println(newStr)  \/\/ \u8f93\u51fa: Hello, Golang!\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5.2.2 <strong>\u6b63\u5219\u8868\u8fbe\u5f0f\uff08regexp\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u7684<code>regexp<\/code>\u5305\u63d0\u4f9b\u4e86\u6b63\u5219\u8868\u8fbe\u5f0f\u652f\u6301\uff0c\u7528\u4e8e\u6a21\u5f0f\u5339\u914d\u548c\u5b57\u7b26\u4e32\u5904\u7406\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u6b63\u5219\u5339\u914d<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"regexp\"\n)\n\nfunc main() {\n    str := \"The Go language is awesome!\"\n\n    \/\/ \u521b\u5efa\u6b63\u5219\u8868\u8fbe\u5f0f\n    re := regexp.MustCompile(`Go`)\n\n    \/\/ \u67e5\u627e\u5339\u914d\n    fmt.Println(re.MatchString(str))  \/\/ \u8f93\u51fa: true\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5.3 <strong>\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u7684\u6807\u51c6\u5e93\u4e2d\u63d0\u4f9b\u4e86\u5b9e\u73b0\u5e38\u89c1\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u7684\u5de5\u5177\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.3.1 <strong>\u6392\u5e8f\u3001\u67e5\u627e<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u5185\u7f6e\u4e86<code>sort<\/code>\u5305\u7528\u4e8e\u5b9e\u73b0\u6392\u5e8f\uff0c<code>search<\/code>\u51fd\u6570\u7528\u4e8e\u4e8c\u5206\u67e5\u627e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u6392\u5e8f<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"sort\"\n)\n\nfunc main() {\n    numbers := &#91;]int{5, 3, 4, 1, 2}\n    sort.Ints(numbers)\n    fmt.Println(\"Sorted numbers:\", numbers)  \/\/ \u8f93\u51fa: Sorted numbers: &#91;1 2 3 4 5]\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5.3.2 <strong>\u94fe\u8868\u3001\u6811\u7b49\u5e38\u7528\u6570\u636e\u7ed3\u6784<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u867d\u7136Go\u6ca1\u6709\u5185\u7f6e\u94fe\u8868\u548c\u6811\u7684\u5b9e\u73b0\uff0c\u4f46\u901a\u8fc7\u6807\u51c6\u5e93\u4e2d\u7684<code>container\/list<\/code>\u5305\u53ef\u4ee5\u5b9e\u73b0\u53cc\u5411\u94fe\u8868\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u81ea\u884c\u5b9e\u73b0\u6811\u7b49\u5176\u4ed6\u6570\u636e\u7ed3\u6784\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u53cc\u5411\u94fe\u8868<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"container\/list\"\n    \"fmt\"\n)\n\nfunc main() {\n    l := list.New()\n    l.PushBack(1)\n    l.PushBack(2)\n    l.PushFront(0)\n\n    for e := l.Front(); e != nil; e = e.Next() {\n        fmt.Println(e.Value)\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8f93\u51fa\u7ed3\u679c\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0\n1\n2<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5.4 <strong>JSON\u4e0e\u5e8f\u5217\u5316<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u901a\u8fc7<code>encoding\/json<\/code>\u5305\u6765\u5904\u7406JSON\u6570\u636e\u7684\u7f16\u7801\u548c\u89e3\u7801\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06Go\u7ed3\u6784\u4f53\u8f6c\u6362\u4e3aJSON\u683c\u5f0f\uff0c\u6216\u5c06JSON\u89e3\u6790\u4e3aGo\u7ed3\u6784\u4f53\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.4.1 <strong>JSON\u89e3\u6790\u4e0e\u751f\u6210\uff08encoding\/json\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u7ed3\u6784\u4f53\u8f6cJSON<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"encoding\/json\"\n    \"fmt\"\n)\n\ntype Person struct {\n    Name string `json:\"name\"`\n    Age  int    `json:\"age\"`\n}\n\nfunc main() {\n    p := Person{Name: \"Alice\", Age: 30}\n    jsonData, err := json.Marshal(p)\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(string(jsonData))  \/\/ \u8f93\u51fa: {\"name\":\"Alice\",\"age\":30}\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1aJSON\u8f6c\u7ed3\u6784\u4f53<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"encoding\/json\"\n    \"fmt\"\n)\n\ntype Person struct {\n    Name string `json:\"name\"`\n    Age  int    `json:\"age\"`\n}\n\nfunc main() {\n    jsonData := `{\"name\":\"Bob\",\"age\":25}`\n    var p Person\n    err := json.Unmarshal(&#91;]byte(jsonData), &amp;p)\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(p)  \/\/ \u8f93\u51fa: {Bob 25}\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5.5 <strong>\u6d4b\u8bd5\u4e0e\u8c03\u8bd5<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u5185\u7f6e\u4e86\u5f3a\u5927\u7684\u6d4b\u8bd5\u6846\u67b6\uff0c\u652f\u6301\u5355\u5143\u6d4b\u8bd5\u3001\u57fa\u51c6\u6d4b\u8bd5\u7b49\u529f\u80fd\u3002\u6b64\u5916\uff0cGo\u4e5f\u63d0\u4f9b\u4e86\u591a\u79cd\u8c03\u8bd5\u5de5\u5177\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.5.1 <strong>\u5355\u5143\u6d4b\u8bd5\uff08testing\u5305\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u7684<code>testing<\/code>\u5305\u652f\u6301\u7f16\u5199\u548c\u6267\u884c\u5355\u5143\u6d4b\u8bd5\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u6d4b\u8bd5\u6587\u4ef6\u6765\u9a8c\u8bc1\u4ee3\u7801\u7684\u6b63\u786e\u6027\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u5355\u5143\u6d4b\u8bd5<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"testing\"\n)\n\nfunc Add(a, b int) int {\n    return a + b\n}\n\nfunc TestAdd(t *testing.T) {\n    result := Add(2, 3)\n    if result != 5 {\n        t.Errorf(\"Expected 5, but got %d\", result)\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c\u5355\u5143\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>go test<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5.5.2 <strong>\u57fa\u51c6\u6d4b\u8bd5<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u7684<code>testing<\/code>\u5305\u4e5f\u652f\u6301\u57fa\u51c6\u6d4b\u8bd5\uff0c\u7528\u4e8e\u6d4b\u8bd5\u51fd\u6570\u7684\u6027\u80fd\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u793a\u4f8b\uff1a\u57fa\u51c6\u6d4b\u8bd5<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"testing\"\n)\n\nfunc BenchmarkAdd(b *testing.B) {\n    for i := 0; i &lt; b.N; i++ {\n        Add(2, 3)\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c\u57fa\u51c6\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>go test -bench .<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5.5.3 <strong>\u8c03\u8bd5\u5de5\u5177\uff08\u5982delve\uff09<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Go\u8bed\u8a00\u7684\u8c03\u8bd5\u5de5\u5177<code>delve<\/code>\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u5305\u62ec\u8bbe\u7f6e\u65ad\u70b9\u3001\u5355\u6b65\u8c03\u8bd5\u3001\u67e5\u770b\u53d8\u91cf\u7b49\u3002\u4f7f\u7528<code>delve<\/code>\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u8c03\u8bd5\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5b89\u88c5delve\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>go get github.com\/go-delve\/delve\/cmd\/dlv<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u542f\u52a8\u8c03\u8bd5\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dlv debug &lt;your_package&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u7ae0\u8282\u8be6\u7ec6\u4ecb\u7ecd\u4e86Go\u8bed\u8a00\u6807\u51c6\u5e93\u4e2d\u4e0eI\/O\u64cd\u4f5c\u3001\u7f51\u7edc\u7f16\u7a0b\u3001\u5b57\u7b26\u4e32\u5904\u7406\u3001\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u3001JSON\u89e3\u6790\u3001\u6d4b\u8bd5\u4e0e\u8c03\u8bd5\u76f8\u5173\u7684\u5de5\u5177\u3002\u638c\u63e1\u8fd9\u4e9b\u6807\u51c6\u5e93\u548c\u5de5\u5177\u5c06\u4f7f\u4f60\u80fd\u591f\u9ad8\u6548\u5730\u5904\u7406\u5404\u79cd\u5f00\u53d1\u4efb\u52a1\uff0c\u5305\u62ec\u6587\u4ef6\u64cd\u4f5c\u3001\u7f51\u7edc\u901a\u4fe1\u3001\u6570\u636e\u5904\u7406\u3001\u6027\u80fd\u6d4b\u8bd5\u4ee5\u53ca\u8c03\u8bd5\u7b49\u3002Go\u8bed\u8a00\u7684\u6807\u51c6\u5e93\u4e0d\u4ec5\u4e30\u5bcc\u4e14\u9ad8\u6548\uff0c\u662f\u5f00\u53d1\u9ad8\u8d28\u91cf\u5e94\u7528\u7684\u57fa\u77f3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go\u8bed\u8a00\u7684\u6807\u51c6\u5e93\u662f\u5176\u5f3a\u5927\u751f\u6001\u7cfb\u7edf\u7684\u6838\u5fc3\uff0c\u63d0\u4f9b\u4e86\u4f17\u591a\u7528\u4e8e\u5e38\u89c1\u5f00\u53d1\u4efb\u52a1\u7684\u5de5\u5177\uff0c\u5305\u62ecI\/O\u64cd\u4f5c\u3001\u7f51\u7edc\u7f16\u7a0b\u3001\u5b57\u7b26\u4e32\u5904\u7406 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-1439","post","type-post","status-publish","format-standard","hentry","category-golang"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=1439"}],"version-history":[{"count":2,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1439\/revisions"}],"predecessor-version":[{"id":1457,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1439\/revisions\/1457"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=1439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=1439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=1439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}