Skip to content

Commit

Permalink
feat: generic 包新增 Unsigned 表示无符号整数的约束类型
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Dec 19, 2023
1 parent 05c65e9 commit 9371890
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/generic/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ type Signed interface {

// Unsigned 无符号整数类型
type Unsigned interface {
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
UnsignedNumber | ~uintptr
}

// UnsignedNumber 无符号数字类型
type UnsignedNumber interface {
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

// Float 浮点类型
Expand Down

0 comments on commit 9371890

Please sign in to comment.