1. 数组
go中的数组需要提前定义好长度
- 初始化 1
var course [3]string
course[0] = "go"
course[1] = "grpc"
course[2] = "gin"
- 初始化 2
course := [3]string{"go", "grpc", "gin"}
- 初始化 3
course := [3]string{1: "gin"}
标签:map,slice,string,初始化,数组,course,go,Go,gin From: https://www.cnblogs.com/forlive/p/17201736.html这种指定索引的初始化,其他位置会为类型的零值
[ gin ]