Golang 笔试面试学习第二天之make
Golang轻松学习
个人博客站点:
简书: 😽 猫轻王 https://www.jianshu.com/u/6cce817646be
掘金: 😽 猫轻王 https://juejin.cn/user/1640918680347453
优快云: 😽 猫轻王 https://blog.youkuaiyun.com/moer0
个人项目主页:https://github.com/moercat
一、make 是什么?
Go 语言中 make 关键字主要用于初始化 slice、map 和 channel 并返回初始化之后的值,这个值并不是零值,也不是指针,而是经过初始化之后的 T 的引用。
二、详细代码
1.make slice的逻辑
代码