Skip to content

Commit a68adae

Browse files
committed
chore: remove the types that are not used
These types were public and are now removed. They were only used to define Number type which is now defined differently. This allows us to simplify the documentation of the package. This is a BREAKING CHANGE
1 parent 0ffb855 commit a68adae

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

types.go

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,11 @@ import (
44
"math"
55
)
66

7-
// This files is highly inspired from https://pkg.go.dev/golang.org/x/exp/constraints
8-
// I didn't import it as it would have added an unnecessary dependency
9-
10-
// Signed is a constraint for all signed integers: int, int8, int16, int32, and int64 types.
11-
type Signed interface {
12-
~int | ~int8 | ~int16 | ~int32 | ~int64
13-
}
14-
15-
// Unsigned is a constraint for all unsigned integers: uint, uint8, uint16, uint32, and uint64 types.
16-
// TODO: support uintpr
17-
type Unsigned interface {
18-
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
19-
}
20-
21-
// Integer is a constraint for the all unsigned and signed integers
22-
type Integer interface {
23-
Signed | Unsigned
24-
}
25-
26-
// Float is a constraint for the float32 and float64 types.
27-
type Float interface {
28-
~float32 | ~float64
29-
}
30-
317
// Number is a constraint for all integers and floats
32-
// TODO: consider using complex, but not sure there is a need
338
type Number interface {
34-
Integer | Float
9+
~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64
10+
11+
// TODO(ccoVeille): consider using complex, but not sure if there is a need
3512
}
3613

3714
func isNegative[T Number](t T) bool {

0 commit comments

Comments
 (0)