Dualcoding con @bachoseven per la pagina "/storia" più qualche miglioria

This commit is contained in:
2022-06-05 14:45:15 +02:00
parent e3b71962e5
commit b2a9355d1d
8 changed files with 208 additions and 102 deletions
+17
View File
@@ -0,0 +1,17 @@
package util
import (
"golang.org/x/exp/constraints"
)
type Numeric interface {
constraints.Float | constraints.Integer
}
func Abs[T Numeric](a T) T {
if a < 0 {
return -a
}
return a
}