a如果是slice就不一样。形如b := a,如果a是slice,则b为引用,如果a是数组,b是整个复制
最终v结果是[1 2 3 0 1 2]
循环次数是v的本来长度,感兴趣的可以去看看range的中间代码
<a href="/interview/44#comment8" title="8">#8<span>楼</span></a> <a href="/user/dingweihua" title="@d...
i的问题其实多声明一个变量拷贝一份就行,用函数参数的方式应该也是拷贝了一份。主线程那个确实是用waitgroup最方便
感谢,有些问题想请教:
1.指令数据什么意思?
2.虚拟内存那张图里两个栈区,是不是有一个是堆?
3.代码区里是放什么,go不是编译成二进制了
interface判空有点骚
gopl上面有说。。slice还是个很有意思的东西。
<a href="/topics/4414#comment5" title="5">#5<span>楼</span></a> <a href="/user/leavesdrift" title="@l...
<a href="/topics/4414#comment3" title="3">#3<span>楼</span></a> <a href="/user/leavesdrift" title="@l...
<a href="/topics/4414#comment1" title="1">#1<span>楼</span></a> <a href="/user/leavesdrift" title="@l...
<a href="/topics/4329#comment1" title="1">#1<span>楼</span></a> <a href="/user/channel" title="@chann...
<a href="/topics/4333#comment1" title="1">#1<span>楼</span></a> <a href="/user/polaris" title="@polar...
老哥问下只用了channel不用go算是并行吗
<a href="/topics/4321#comment1" title="1">#1<span>楼</span></a> <a href="/user/specita" title="@speci...
<a href="/user/polaris" title="@polaris">@polaris</a> 我知道了。。看到了。谢谢老哥
<a href="/user/polaris" title="@polaris">@polaris</a> 那这种问题应该到哪里问。。老哥