feat: 基础数据类型字符串转数组
This commit is contained in:
@ -11,24 +11,30 @@ import "git.zhangdeman.cn/zhangdeman/op_type"
|
||||
|
||||
// BaseValueResult 基础类型转换结果
|
||||
type BaseValueResult[BaseType op_type.BaseType] struct {
|
||||
Value BaseType `json:"result"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
Value BaseType `json:"value"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
}
|
||||
|
||||
// BaseValuePtrResult 基础类型指针转换结果
|
||||
type BaseValuePtrResult[BaseType op_type.BaseType] struct {
|
||||
Value *BaseType `json:"result"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
Value *BaseType `json:"value"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
}
|
||||
|
||||
// MapValueResult map类型转换结果
|
||||
type MapValueResult[Key comparable, Value any] struct {
|
||||
Value map[Key]Value `json:"result"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
Value map[Key]Value `json:"value"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
}
|
||||
|
||||
// StructValueResult struct类型转换结果
|
||||
type StructValueResult[Value any] struct {
|
||||
Value Value `json:"result"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
Value Value `json:"value"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
}
|
||||
|
||||
// BaseValueSliceResult 基础类型切片转换结果
|
||||
type BaseValueSliceResult[BaseType op_type.BaseType] struct {
|
||||
Value []BaseType `json:"value"` // 转换结果
|
||||
Err error `json:"err"` // 错误信息
|
||||
}
|
||||
|
Reference in New Issue
Block a user