new json_data model
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// return any input type to float32
|
||||
func Float32From(v any) float32 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -44,6 +45,7 @@ func Float32From(v any) float32 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to float64
|
||||
func Float64From(v any) float64 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -83,6 +85,7 @@ func Float64From(v any) float64 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to int8
|
||||
func Int8From(v any) int8 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -122,6 +125,7 @@ func Int8From(v any) int8 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to int16
|
||||
func Int16From(v any) int16 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -161,6 +165,7 @@ func Int16From(v any) int16 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to int32
|
||||
func Int32From(v any) int32 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -200,6 +205,7 @@ func Int32From(v any) int32 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to int64
|
||||
func Int64From(v any) int64 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -239,6 +245,7 @@ func Int64From(v any) int64 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to int
|
||||
func Uint8From(v any) uint8 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -278,6 +285,7 @@ func Uint8From(v any) uint8 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to uint16
|
||||
func Uint16From(v any) uint16 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -317,6 +325,7 @@ func Uint16From(v any) uint16 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to uint32
|
||||
func Uint32From(v any) uint32 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -356,6 +365,7 @@ func Uint32From(v any) uint32 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to uint64
|
||||
func Uint64From(v any) uint64 {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
@@ -395,6 +405,7 @@ func Uint64From(v any) uint64 {
|
||||
}
|
||||
}
|
||||
|
||||
// return any input type to bool
|
||||
func BoolFrom(v any) bool {
|
||||
switch val := v.(type) {
|
||||
case bool:
|
||||
|
Reference in New Issue
Block a user