{"id":10006103,"date":"2022-08-04T11:39:34","date_gmt":"2022-08-04T03:39:34","guid":{"rendered":"https:\/\/ityet.com\/?p=10006103"},"modified":"2022-08-04T11:39:34","modified_gmt":"2022-08-04T03:39:34","slug":"go-string-%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006103","title":{"rendered":"Go String \u89e3\u6790"},"content":{"rendered":"<h3>\u4e00\u3001String \u7ed3\u6784\u5b9a\u4e49<\/h3>\n<pre><code class=\"golang\">\/\/ src\/runtime\/string.go:stringStruct\n\ntype stringStruct struct {\n    str unsafe.Pointer\n    len int\n}<\/code><\/pre>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1vO3\" alt=\"String\u7ed3\u6784\u5b9a\u4e49\" title=\"String\u7ed3\u6784\u5b9a\u4e49\" loading=\"lazy\"><\/p>\n<p><strong>String<\/strong> \u7c7b\u578b\u5728Go\u8bed\u8a00\u5185\u5b58\u6a21\u578b\u4e2d\u5176\u5b9e\u662f\u4e00\u4e2a\u201c\u63cf\u8ff0\u7b26\u201d\uff0c\u7528\u4e00\u4e2a2\u5b57\u8282\u7684\u6570\u636e\u7ed3\u6784\u8868\u793a\uff0c\u5b83\u672c\u8eab\u5e76\u4e0d\u771f\u6b63\u5b58\u50a8\u5b57\u7b26\u4e32\u6570\u636e\uff0c\u800c\u4ec5\u662f\u7531\u4e00\u4e2a\u6307\u5411\u5e95\u5c42\u5b58\u50a8\u7684\u6307\u9488\u548c\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u5b57\u6bb5\u7ec4\u6210\u7684\u3002<\/p>\n<p><strong>str<\/strong>\uff1a\u6307\u5411\u5b57\u7b26\u4e32\u5e95\u5c42\u5b58\u50a8\u9996\u5730\u5740\u7684\u6307\u9488\uff0c1\u5b57\u8282\u3002<br \/><strong>len<\/strong>\uff1a\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\uff0c1\u5b57\u8282\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u6211\u4eec\u5373\u4fbf\u76f4\u63a5\u5c06 <strong>String<\/strong> \u7c7b\u578b\u53d8\u91cf\u4f5c\u4e3a\u51fd\u6570\u53c2\u6570\uff0c\u5176\u4f20\u9012\u7684\u5f00\u9500\u4e5f\u662f\u6052\u5b9a\u7684\uff0c\u4e0d\u4f1a\u968f\u7740\u5b57\u7b26\u4e32\u5927\u5c0f\u7684\u53d8\u5316\u800c\u53d8\u5316\u3002<\/p>\n<h3>\u4e8c\u3001String \u7279\u6027<\/h3>\n<h4>1. String \u7c7b\u578b\u7684\u503c\u5728\u5b83\u7684\u751f\u547d\u5468\u671f\u5185\u4e0d\u53ef\u6539\u53d8<\/h4>\n<pre><code class=\"golang\">type stringStruct struct {\n    str unsafe.Pointer\n    len int\n}\n\nfunc main() {\n    var s string = &quot;hello&quot;\n\n    s[0] = 'a' \/\/\u9519\u8bef\uff1a\u65e0\u6cd5\u7ed9s[0]\u8d4b\u503c\uff0c\u56e0\u4e3a\u5b57\u7b26\u4e32\u5185\u5bb9\u662f\u4e0d\u53ef\u6539\u53d8\u7684\n\n    fmt.Printf(&quot;%#v\/n&quot;, (*stringStruct)(unsafe.Pointer(&amp;s))) \n    \/\/\u8f93\u51fa\uff1a&amp;main.stringStruct{str:(unsafe.Pointer)(0x2b599c), len:5}\n\n    s = &quot;world&quot; \/\/\u4fee\u6539\u5b57\u7b26\u4e32\uff0c\u5b57\u7b26\u4e32\u5e95\u5c42\u7ed3\u6784\u4f53\u4e2dstr\u6307\u9488\u5df2\u7ecf\u53d1\u751f\u53d8\u5316\n    \n    fmt.Printf(&quot;%#v\/n&quot;, (*stringStruct)(unsafe.Pointer(&amp;s))) \n    \/\/\u8f93\u51fa\uff1a&amp;main.stringStruct{str:(unsafe.Pointer)(0x2b5a00), len:5}\n    \n    fmt.Printf(&quot;%#v\/n&quot;, (*[5]byte)((*stringStruct)(unsafe.Pointer(&amp;s)).str)) \n    \/\/\u8f93\u51fa\uff1a&amp;[5]uint8{0x77, 0x6f, 0x72, 0x6c, 0x64} \u5206\u522b\u5bf9\u5e94 w o r l d \u7684 ASCII \u7801\n}<\/code><\/pre>\n<blockquote><p>\u7531\u4e8eruntime.stringStruct\u7ed3\u6784\u662f\u975e\u5bfc\u51fa\u7684\uff0c\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\uff0c\u6240\u4ee5\u624b\u52a8\u5b9a\u4e49\u4e86\u4e00\u4e2astringStruct\u7ed3\u6784\u4f53\u3002<\/p><\/blockquote>\n<p>String \u7c7b\u578b\u7684\u6570\u636e\u4e0d\u53ef\u6539\u53d8\u7684\u7279\u6027\uff0c\u63d0\u9ad8\u4e86\u5b57\u7b26\u4e32\u7684<strong>\u5e76\u53d1\u5b89\u5168\u6027<\/strong>\u548c<strong>\u5b58\u50a8\u5229\u7528\u7387<\/strong>\u3002<\/p>\n<ul>\n<li>\u5b57\u7b26\u4e32\u53ef\u4ee5\u88ab\u591a\u4e2a\u534f\u7a0b\u5171\u4eab\uff0c\u5f00\u53d1\u8005\u4e0d\u7528\u518d\u62c5\u5fc3\u5b57\u7b26\u4e32\u7684\u5e76\u53d1\u5b89\u5168\u95ee\u9898\u3002<\/li>\n<li>\u9488\u5bf9\u540c\u4e00\u4e2a\u5b57\u7b26\u4e32\u503c\uff0c\u65e0\u8bba\u5b83\u5728\u7a0b\u5e8f\u7684\u51e0\u4e2a\u4f4d\u7f6e\u88ab\u4f7f\u7528\uff0c\u7f16\u8bd1\u5668\u53ea\u9700\u8981\u4e3a\u5b83\u5206\u914d\u4e00\u5757\u5b58\u50a8\uff0c\u5927\u5927\u63d0\u9ad8\u4e86\u5b58\u50a8\u5229\u7528\u7387\u3002<\/li>\n<\/ul>\n<h4>2. \u6ca1\u6709\u7ed3\u5c3e\u2019\/0\u2019\uff0c\u5b58\u50a8\u4e86\u5b57\u7b26\u4e32\u957f\u5ea6<\/h4>\n<p>Go \u5b57\u7b26\u4e32\u4e2d\u6ca1\u6709\u7ed3\u5c3e\u2019\/0\u2019\uff0c\u5e76\u4e14\u5b58\u50a8\u4e86\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u83b7\u53d6\u5b57\u7b26\u4e32\u957f\u5ea6\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f\u5e38\u6570\uff0c\u65e0\u8bba\u5b57\u7b26\u4e32\u4e2d\u5b57\u7b26\u4e2a\u6570\u6709\u591a\u5c11\uff0c\u6211\u4eec\u90fd\u53ef\u4ee5\u5feb\u901f\u5f97\u5230\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u503c\u3002<\/p>\n<h4>3. String \u53ef\u4ee5\u662f\u7a7a\u7684<code>&quot;&quot;<\/code>\uff0c\u4f46\u4e0d\u80fd\u662f <code>nil<\/code><\/h4>\n<pre><code class=\"golang\">var s string = &quot;&quot;\ns = nil \/\/ \u9519\u8bef<\/code><\/pre>\n<h4>4. \u5bf9\u975e ASCII \u5b57\u7b26\u63d0\u4f9b\u539f\u751f\u652f\u6301\uff0c\u6d88\u9664\u4e86\u6e90\u7801\u5728\u4e0d\u540c\u73af\u5883\u4e0b\u663e\u793a\u4e71\u7801\u7684\u53ef\u80fd<\/h4>\n<p>Go \u8bed\u8a00\u6e90\u6587\u4ef6\u9ed8\u8ba4\u91c7\u7528\u7684\u662f Unicode \u5b57\u7b26\u96c6\uff0cUnicode \u5b57\u7b26\u96c6\u662f\u76ee\u524d\u5e02\u9762\u4e0a\u6700\u6d41\u884c\u7684\u5b57\u7b26\u96c6\uff0c\u5b83\u56ca\u62ec\u4e86\u51e0\u4e4e\u6240\u6709\u4e3b\u6d41\u975e ASCII \u5b57\u7b26\uff08\u5305\u62ec\u4e2d\u6587\u5b57\u7b26\uff09\u3002<br \/>Go \u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\u90fd\u662f\u4e00\u4e2a Unicode \u5b57\u7b26\uff0c\u5e76\u4e14\u8fd9\u4e9b Unicode \u5b57\u7b26\u662f\u4ee5 UTF-8 \u7f16\u7801\u683c\u5f0f\u5b58\u50a8\u5728\u5185\u5b58\u5f53\u4e2d\u7684\u3002<\/p>\n<h4>5. \u539f\u751f\u652f\u6301\u201c\u6240\u89c1\u5373\u6240\u5f97\u201d\u7684\u539f\u59cb\u5b57\u7b26\u4e32\uff0c\u5927\u5927\u964d\u4f4e\u6784\u9020\u591a\u884c\u5b57\u7b26\u4e32\u65f6\u7684\u5fc3\u667a\u8d1f\u62c5\u3002<\/h4>\n<pre><code class=\"golang\">var s string = `         ,_---~~~~~----._\n    _,,_,*^____      _____*g*\/&quot;*,--,\n   \/ __\/ \/'     ^.  \/      \/ ^@q   f\n  [  @f | @))    |  | @))   l  0 _\/\n   \/\/   \/~____ \/ __ \/_____\/     \/\n    |           _l__l_           I\n    }          [______]           I\n    ]            | | |            |\n    ]             ~ ~             |\n    |                            |\n     |                           |`\nfmt.Println(s)<\/code><\/pre>\n<h3>\u4e09\u3001String \u5e38\u89c4\u64cd\u4f5c<\/h3>\n<h4>1. \u4e0b\u6807\u64cd\u4f5c<\/h4>\n<p>\u5728\u5b57\u7b26\u4e32\u7684\u5b9e\u73b0\u4e2d\uff0c\u771f\u6b63\u5b58\u50a8\u6570\u636e\u7684\u662f\u5e95\u5c42\u7684\u6570\u7ec4\u3002\u5b57\u7b26\u4e32\u7684\u4e0b\u6807\u64cd\u4f5c\u672c\u8d28\u4e0a\u7b49\u4ef7\u4e8e\u5e95\u5c42\u6570\u7ec4\u7684\u4e0b\u6807\u64cd\u4f5c\u3002\u6211\u4eec\u5728\u524d\u9762\u7684\u4ee3\u7801\u4e2d\u5b9e\u9645\u78b0\u5230\u8fc7\u9488\u5bf9\u5b57\u7b26\u4e32\u7684\u4e0b\u6807\u64cd\u4f5c\uff0c\u5f62\u5f0f\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<pre><code class=\"golang\">var s = &quot;\u4e58\u98ce\u7834\u6d6a&quot;\nfmt.Printf(&quot;0x%x\/n&quot;, s[0]) \/\/ 0xe4\uff1a\u5b57\u7b26\u201c\u4e58\u201d utf-8\u7f16\u7801\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282<\/code><\/pre>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u901a\u8fc7\u4e0b\u6807\u64cd\u4f5c\uff0c\u6211\u4eec\u83b7\u53d6\u7684\u662f\u5b57\u7b26\u4e32\u4e2d\u7279\u5b9a\u4e0b\u6807\u4e0a\u7684\u5b57\u8282\uff0c\u800c\u4e0d\u662f\u5b57\u7b26\u3002<\/p>\n<h4>2. \u5b57\u7b26\u8fed\u4ee3<\/h4>\n<p>Go \u6709\u4e24\u79cd\u8fed\u4ee3\u5f62\u5f0f\uff1a<strong>\u5e38\u89c4 for \u8fed\u4ee3<\/strong>\u4e0e <strong>for range \u8fed\u4ee3<\/strong>\u3002<br \/>\u901a\u8fc7\u8fd9\u4e24\u79cd\u5f62\u5f0f\u7684\u8fed\u4ee3\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u64cd\u4f5c\u5f97\u5230\u7684\u7ed3\u679c\u662f\u4e0d\u540c\u7684\u3002<\/p>\n<p><strong>\u901a\u8fc7\u5e38\u89c4 for \u8fed\u4ee3\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u7684\u64cd\u4f5c\u662f\u4e00\u79cd\u5b57\u8282\u89c6\u89d2\u7684\u8fed\u4ee3\uff0c\u6bcf\u8f6e\u8fed\u4ee3\u5f97\u5230\u7684\u7684\u7ed3\u679c\u90fd\u662f\u7ec4\u6210\u5b57\u7b26\u4e32\u5185\u5bb9\u7684\u4e00\u4e2a\u5b57\u8282\uff0c\u4ee5\u53ca\u8be5\u5b57\u8282\u6240\u5728\u7684\u4e0b\u6807\u503c<\/strong>\uff0c\u8fd9\u4e5f\u7b49\u4ef7\u4e8e\u5bf9\u5b57\u7b26\u4e32\u5e95\u5c42\u6570\u7ec4\u7684\u8fed\u4ee3\uff1a<\/p>\n<pre><code class=\"golang\">var s = &quot;\u4e58\u98ce\u7834\u6d6a&quot;\nfor i := 0; i &lt; len(s); i++ {\n    fmt.Printf(&quot;index: %d, value: 0x%x\/n&quot;, i, s[i])\n}<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<\/p>\n<pre><code>index: 0, value: 0xe4\nindex: 1, value: 0xb9\nindex: 2, value: 0x98 \/\/ &quot;\/xe4\/xb9\/x98&quot; \u4e58\nindex: 3, value: 0xe9\nindex: 4, value: 0xa3\nindex: 5, value: 0x8e \/\/ &quot;\/xe9\/xa3\/x8e&quot; \u98ce\nindex: 6, value: 0xe7\nindex: 7, value: 0xa0\nindex: 8, value: 0xb4 \/\/ &quot;\/xe7\/xa0\/xb4&quot; \u7834\nindex: 9, value: 0xe6\nindex: 10, value: 0xb5\nindex: 11, value: 0xaa \/\/ &quot;\/xe6\/xb5\/xaa&quot; \u6d6a<\/code><\/pre>\n<p><strong>\u901a\u8fc7 for range \u8fed\u4ee3\uff0c\u6211\u4eec\u6bcf\u8f6e\u8fed\u4ee3\u5f97\u5230\u7684\u662f\u5b57\u7b26\u4e32\u4e2d Unicode \u5b57\u7b26\u7684\u7801\u70b9\u503c\uff0c\u4ee5\u53ca\u8be5\u5b57\u7b26\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u504f\u79fb\u503c<\/strong>\uff1a<\/p>\n<pre><code class=\"golang\">var s = &quot;\u4e58\u98ce\u7834\u6d6a&quot;\nfor i, v := range s {\n    fmt.Printf(&quot;index: %d, value: 0x%x\/n&quot;, i, v)\n}<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<\/p>\n<pre><code>index: 0, value: 0x4e58\nindex: 3, value: 0x98ce\nindex: 6, value: 0x7834\nindex: 9, value: 0x6d6a<\/code><\/pre>\n<h4>3. \u5b57\u7b26\u4e32\u8fde\u63a5<\/h4>\n<p>\u867d\u7136\u901a\u8fc7 +\/+= \u8fdb\u884c\u5b57\u7b26\u4e32\u8fde\u63a5\u7684\u5f00\u53d1\u4f53\u9a8c\u662f\u6700\u597d\u7684\uff0c\u4f46\u8fde\u63a5\u6027\u80fd\u5c31\u672a\u5fc5\u662f\u6700\u5feb\u7684\u4e86\u3002<br \/>Go \u8fd8\u63d0\u4f9b\u4e86 strings.Builder\u3001strings.Join\u3001fmt.Sprintf \u7b49\u51fd\u6570\u6765\u8fdb\u884c\u5b57\u7b26\u4e32\u8fde\u63a5\u64cd\u4f5c\u3002<\/p>\n<h4>4. \u5b57\u7b26\u4e32\u6bd4\u8f83<\/h4>\n<p>Go \u5b57\u7b26\u4e32\u7c7b\u578b\u652f\u6301\u5404\u79cd\u6bd4\u8f83\u5173\u7cfb\u64cd\u4f5c\u7b26\uff0c\u5305\u62ec <code>==<\/code>\u3001<code>!=<\/code> \u3001<code>&gt;=<\/code>\u3001<code>&lt;=<\/code>\u3001<code>&gt;<\/code> \u548c <code>&lt;<\/code>\u3002\u5728\u5b57\u7b26\u4e32\u7684\u6bd4\u8f83\u4e0a\uff0cGo \u91c7\u7528\u5b57\u5178\u5e8f\u7684\u6bd4\u8f83\u7b56\u7565\uff0c\u5206\u522b\u4ece\u6bcf\u4e2a\u5b57\u7b26\u4e32\u7684\u8d77\u59cb\u5904\uff0c\u5f00\u59cb\u9010\u4e2a\u5b57\u8282\u5730\u5bf9\u4e24\u4e2a\u5b57\u7b26\u4e32\u7c7b\u578b\u53d8\u91cf\u8fdb\u884c\u6bd4\u8f83\u3002<br \/>\u5f53\u4e24\u4e2a\u5b57\u7b26\u4e32\u4e4b\u95f4\u51fa\u73b0\u4e86\u7b2c\u4e00\u4e2a\u4e0d\u76f8\u540c\u7684\u5143\u7d20\uff0c\u6bd4\u8f83\u5c31\u7ed3\u675f\u4e86\uff0c\u8fd9\u4e24\u4e2a\u5143\u7d20\u7684\u6bd4\u8f83\u7ed3\u679c\u5c31\u4f1a\u505a\u4e3a\u4e32\u6700\u7ec8\u7684\u6bd4\u8f83\u7ed3\u679c\u3002\u5982\u679c\u51fa\u73b0\u4e24\u4e2a\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u540c\u7684\u60c5\u51b5\uff0c\u957f\u5ea6\u6bd4\u8f83\u5c0f\u7684\u5b57\u7b26\u4e32\u4f1a\u7528\u7a7a\u5143\u7d20\u8865\u9f50\uff0c\u7a7a\u5143\u7d20\u6bd4\u5176\u4ed6\u975e\u7a7a\u5143\u7d20\u90fd\u5c0f\u3002<\/p>\n<p>\u5982\u679c\u4e24\u4e2a\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u4e0d\u76f8\u540c\uff0c\u90a3\u4e48\u6211\u4eec\u4e0d\u9700\u8981\u6bd4\u8f83\u5177\u4f53\u5b57\u7b26\u4e32\u6570\u636e\uff0c\u4e5f\u53ef\u4ee5\u65ad\u5b9a\u4e24\u4e2a\u5b57\u7b26\u4e32\u662f\u4e0d\u540c\u7684\u3002\u4f46\u662f\u5982\u679c\u4e24\u4e2a\u5b57\u7b26\u4e32\u957f\u5ea6\u76f8\u540c\uff0c\u5c31\u8981\u8fdb\u4e00\u6b65\u5224\u65ad\uff0c\u6570\u636e\u6307\u9488\u662f\u5426\u6307\u5411\u540c\u4e00\u5757\u5e95\u5c42\u5b58\u50a8\u6570\u636e\u3002\u5982\u679c\u8fd8\u76f8\u540c\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u8bf4\u4e24\u4e2a\u5b57\u7b26\u4e32\u662f\u7b49\u4ef7\u7684\uff0c\u5982\u679c\u4e0d\u540c\uff0c\u90a3\u5c31\u8fd8\u9700\u8981\u8fdb\u4e00\u6b65\u53bb\u6bd4\u5bf9\u5b9e\u9645\u7684\u6570\u636e\u5185\u5bb9\u3002<\/p>\n<pre><code class=\"golang\">func main() {\n    \/\/ ==\n    s1 := &quot;\u4e58\u98ce\u7834\u6d6a&quot;\n    s2 := &quot;\u4e58\u98ce&quot; + &quot;\u7834\u6d6a&quot;\n    fmt.Println(s1 == s2) \/\/ true\n\n    \/\/ !=\n    s1 = &quot;Go&quot;\n    s2 = &quot;PHP&quot;\n    fmt.Println(s1 != s2) \/\/ true\n\n    \/\/ &lt; and &lt;=\n    s1 = &quot;12345&quot;\n    s2 = &quot;23456&quot;\n    fmt.Println(s1 &lt; s2)  \/\/ true\n    fmt.Println(s1 &lt;= s2) \/\/ true\n\n    \/\/ &gt; and &gt;=\n    s1 = &quot;12345&quot;\n    s2 = &quot;123&quot;\n    fmt.Println(s1 &gt; s2)  \/\/ true\n    fmt.Println(s1 &gt;= s2) \/\/ true\n}<\/code><\/pre>\n<h4>\u7b2c\u4e94\u4e2a\u64cd\u4f5c\uff1a\u5b57\u7b26\u4e32\u8f6c\u6362\u3002<\/h4>\n<p>Go \u652f\u6301\u5b57\u7b26\u4e32\u4e0e\u5b57\u8282\u5207\u7247\u3001\u5b57\u7b26\u4e32\u4e0e rune \u5207\u7247\u7684\u53cc\u5411\u8f6c\u6362\uff0c\u5e76\u4e14\u8fd9\u79cd\u8f6c\u6362\u65e0\u9700\u8c03\u7528\u4efb\u4f55\u51fd\u6570\uff0c\u53ea\u9700\u4f7f\u7528\u663e\u5f0f\u7c7b\u578b\u8f6c\u6362\u5c31\u53ef\u4ee5\u4e86<\/p>\n<pre><code class=\"golang\">var s = &quot;\u4e58\u98ce\u7834\u6d6a&quot;\n\n\/\/ string -&gt; []rune\nrs := []rune(s)\nfmt.Printf(&quot;%x\/n&quot;, rs) \/\/ [4e58 98ce 7834 6d6a]\n\n\/\/ string -&gt; []byte\nbs := []byte(s)\nfmt.Printf(&quot;%x\/n&quot;, bs) \/\/ e4b998e9a38ee7a0b4e6b5aa\n\n\/\/ []rune -&gt; string\ns1 := string(rs)\nfmt.Println(s1) \/\/ \u4e58\u98ce\u7834\u6d6a\n\n\/\/ []byte -&gt; string\ns2 := string(bs)\nfmt.Println(s2) \/\/ \u4e58\u98ce\u7834\u6d6a<\/code><\/pre>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042267345\">https:\/\/segmentfault.com\/a\/1190000042267345<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001String \u7ed3\u6784\u5b9a\u4e49 \/\/ src\/runtime\/string.go:stringStruct typ [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006103","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006103","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"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006103"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006103\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}