golang 面试一:make和new的区别
golang 面试一:make和new的区别makenew区别
new和make都是golang的内建函数,都用于分配内存
make
先看一下make函数的定义
// The make built-in function allocates and initializes an object of type
// slice, map, or chan (only). Like new, the first argument is a type, not a
// value. Unlike new, ma
原创
2021-08-17 23:08:47 ·
397 阅读 ·
0 评论