1 Star 0 Fork 0

zhen / go_demo_keyauth

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ptr_value.go 498 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhen 提交于 2023-04-25 16:50 . 权限认证
package utils
func PtrStrV(v *string) string {
if v == nil {
return ""
}
return *v
}
func PtrInt64(v *int64) int64 {
if v == nil {
return 0
}
return *v
}
func PtrInt32(v *int32) int32 {
if v == nil {
return 0
}
return *v
}
func PtrFloat64(v *float64) float64 {
if v == nil {
return 0
}
return *v
}
func SlicePtrStrv(items []*string) []string {
vs := []string{}
for i := range items {
v := PtrStrV(items[i])
if v != "" {
vs = append(vs, v)
}
}
return vs
}
1
https://gitee.com/easy_code/go_demo_keyauth.git
git@gitee.com:easy_code/go_demo_keyauth.git
easy_code
go_demo_keyauth
go_demo_keyauth
33290b63155e

搜索帮助