go20/day01/pointer/pointer.drawio
yumaojun03 243907d045 ```
docs(day01): 完善Go语言基础教程内容

- 添加指针概念章节,包含指针的基本概念、使用场景和示例代码
- 补充基础类型章节的零值说明,解释各种基础类型的默认值
- 扩展运算符章节,增加逻辑运算符和位运算符的详细说明
- 更新README目录结构,添加新章节的导航链接
- 添加指针相关的演示图表和示例代码文件
```
2025-12-28 17:26:05 +08:00

133 lines
11 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<mxfile host="65bd71144e">
<diagram id="bRV9rv3DatMBVeH1xIMn" name="第 1 页">
<mxGraphModel dx="797" dy="617" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="变量(插槽)&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;插槽的地址(编号)&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="340" y="200" width="120" height="70" as="geometry"/>
</mxCell>
<mxCell id="7" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="3" target="2">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="11" value="赋值" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7">
<mxGeometry x="0.2182" y="-1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="3" value="值&lt;div&gt;(string)&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="570" y="200" width="120" height="70" as="geometry"/>
</mxCell>
<mxCell id="6" value="分类(类型)&lt;div&gt;string&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="370" y="150" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="8" value="&quot;bob&quot;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="600" y="310" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="12" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="9" target="8">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="13" value="变量的值" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="12">
<mxGeometry x="-0.2353" y="2" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="16" style="edgeStyle=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="9" target="2">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="9" value="name" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="370" y="310" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="14" value="运算符" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="690" y="80" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="17" value="a" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="330" y="460" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="23" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="18" target="17">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="18" value="10" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="590" y="460" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="19" value="b" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="330" y="590" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="24" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="20" target="19">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="20" value="20" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="590" y="590" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="21" value="c" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="100" y="530" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="22" value="30" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="590" y="730" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="25" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.442;entryY=1.017;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="22" target="21">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="27" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="100" y="960" width="630" height="140" as="geometry"/>
</mxCell>
<mxCell id="29" value="&lt;div style=&quot;color: rgb(248, 248, 242); background-color: rgb(39, 40, 34); font-family: &amp;quot;Cascadia Code NF&amp;quot;, Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace, Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;sumWithPointer&lt;/span&gt;&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="310" y="920" width="150" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="result插槽的值: 0" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="150" y="930" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="32" value="a插槽的值: 10" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="450" y="930" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="33" value="b插槽的值 20" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="930" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="34" value="函数接收的是插槽里面的值(值传递)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="300" y="860" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="35" value="c: 30&lt;div&gt;没被使用等待GC销毁&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="220" y="1020" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="36" value="result插槽的值: 0" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="150" y="830" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="37" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="100" y="1320" width="630" height="140" as="geometry"/>
</mxCell>
<mxCell id="38" value="&lt;div style=&quot;color: rgb(248, 248, 242); background-color: rgb(39, 40, 34); font-family: &amp;quot;Cascadia Code NF&amp;quot;, Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace, Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; line-height: 18px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: #a6e22e;&quot;&gt;sumWithPointer&lt;/span&gt;&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="310" y="1280" width="150" height="30" as="geometry"/>
</mxCell>
<mxCell id="39" value="result插槽地址(编号)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="150" y="1290" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="40" value="a插槽的值: 10" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="450" y="1290" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="41" value="b插槽的值 20" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="1290" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="42" value="函数接收的是插槽里面的值(值传递)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="300" y="1220" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="48" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="43" target="39">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="43" value="30" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="354" y="1380" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="46" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="45" target="39">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="47" value="通过 &amp;amp; 获取插槽的地址(编号)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="46">
<mxGeometry x="-0.0857" y="-1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="45" value="result 插槽" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="150" y="1160" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>