Skip to content

Commit 044b281

Browse files
Potential fix for code scanning alert no. 391: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 908c9b8 commit 044b281

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/yeartype.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (t yearType) Convert(v interface{}) (interface{}, error) {
116116
if value < float64(math.MinInt16) || value > float64(math.MaxInt16) {
117117
return nil, ErrConvertingToYear.New("float64 value out of bounds for int16")
118118
}
119-
return t.Convert(int16(value))
119+
return int16(value), nil
120120
case decimal.Decimal:
121121
return t.Convert(value.IntPart())
122122
case decimal.NullDecimal:

0 commit comments

Comments
 (0)