diff --git a/pkg/utils.go b/pkg/utils.go index 2a96c7d..a9e3981 100644 --- a/pkg/utils.go +++ b/pkg/utils.go @@ -2,7 +2,7 @@ package gomus import "log" -func mapList[T any, R any](l []T, f func(T) R) []R { +func MapList[T any, R any](l []T, f func(T) R) []R { var c []R = []R{} for _, item := range l { c = append(c, f(item)) @@ -16,10 +16,6 @@ func check(err error) { } } -type Numeric interface { - float64 -} - -func MapFloatBetween[T Numeric](value, start1, stop1, start2, stop2 T) T { +func MapFloatBetween(value, start1, stop1, start2, stop2 float64) float64 { return start2 + (value-start1)*(stop2-start2)/(stop1-start1) }