Skip to content

Commit

Permalink
Update codes for lints/security
Browse files Browse the repository at this point in the history
  • Loading branch information
johnteee committed Nov 10, 2023
1 parent 4888846 commit 23d8e28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion maybe.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ func (maybeSelf someDef[T]) ToInt8() (int8, error) {
return 0, ErrConversionSizeOverflow
case byte:
val, err := maybeSelf.ToByte()
return int8(val), err
if val <= math.MaxInt8 {
return int8(val), err
}
return 0, ErrConversionSizeOverflow
case int:
val, err := maybeSelf.ToInt()
if val >= math.MinInt8 && val <= math.MaxInt8 {
Expand Down

0 comments on commit 23d8e28

Please sign in to comment.