1 Star 0 Fork 20

aiopsxzlinux / gobatis

forked from aurora-engine / gobatis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
value.go 566 Bytes
一键复制 编辑 原始数据 按行查看 历史
package gobatis
import "strconv"
func elementValue(value any) (v string, flag bool, err error) {
switch value.(type) {
case string:
v = value.(string)
flag = true
case int:
v = strconv.Itoa(value.(int))
case int64:
v = strconv.FormatInt(value.(int64), 64)
case float64:
v = strconv.FormatFloat(value.(float64), 'f', 2, 64)
case bool:
v = strconv.FormatBool(value.(bool))
default:
// 其他复杂数据类型
if handle, err := dataHandle(value); err != nil {
return "", flag, err
} else {
return elementValue(handle)
}
}
return
}
Go
1
https://gitee.com/aiopsxzlinux/gobatis.git
git@gitee.com:aiopsxzlinux/gobatis.git
aiopsxzlinux
gobatis
gobatis
master

搜索帮助