企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 第1.4结构体 结构体复杂类型 ``` <pre class="calibre16">``` type Point struct <span class="token2">{</span> X int Y int <span class="token2">}</span> var p Point 初始化结构体 p<span class="token2">.</span>X <span class="token">=</span> <span class="token3">10</span> p<span class="token2">.</span>Y <span class="token">=</span> <span class="token3">20</span> test <span class="token2">:</span><span class="token">=</span><span class="token5">new</span><span class="token2">(</span>Point<span class="token2">)</span> 指针类型结构体初始化 test <span class="token2">:</span><span class="token">=</span> <span class="token">&</span>Point<span class="token2">{</span> name<span class="token2">:</span><span class="token4">"测试"</span> <span class="token2">}</span> 去结构体地址实例化 ``` ```