Skip to content

Commit

Permalink
Support float32
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Nov 12, 2024
1 parent a5e7f2a commit bc36d59
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func (m *Mapping) Dup() Mapping {
var ns []int
ns = append(ns, vt...)
new[k] = ns
case []float32:
var ns []float32
ns = append(ns, vt...)
new[k] = ns
case []float64:
var ns []float64
ns = append(ns, vt...)
Expand All @@ -110,6 +114,10 @@ func (m *Mapping) Dup() Mapping {
var ns []time.Time
ns = append(ns, vt...)
new[k] = ns
case []time.Duration:
var ns []time.Duration
ns = append(ns, vt...)
new[k] = ns
case []byte:
var ns []byte
ns = append(ns, vt...)
Expand Down Expand Up @@ -150,7 +158,7 @@ func cleanUpMapValue(v any) any {
return cleanUpInterfaceArray(v)
case map[string]any:
return cleanUpInterfaceMap(v)
case string, bool, byte, int, float64, time.Time, nil:
case string, bool, byte, int, float32, float64, time.Time, time.Duration, nil:
return v
default:
return fmt.Sprintf("%v", v)
Expand Down

0 comments on commit bc36d59

Please sign in to comment.