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 Oct 22, 2024
1 parent a79f856 commit 3b9192e
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 @@ -373,7 +373,10 @@ func (maybeSelf someDef) 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 3b9192e

Please sign in to comment.