func BoolPtr(v bool) *bool {
return &v
}
func StringPtr(v string) *string {
return &v
}
func StringPtrs(vals []string) []*string {
ptrs := make([]*string, len(vals))
for i := 0; i < len(vals); i++ {
ptrs[i] = &vals[i]
}
return ptrs
}
翻译
搜索
复制
标签:return,string,StringPtr,ptrs,vals,StringPtrs,字符串,指针 From: https://www.cnblogs.com/papering/p/17481295.html