Skip to content

Commit 3b6494e

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

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
@@ -117,7 +117,7 @@ func (t yearType) Convert(v interface{}) (interface{}, error) {
117117
return nil, ErrConvertingToYear.New("float64 value out of bounds for int16")
118118
}
119119
// Check for fractional part
120-
if value != float64(int16(value)) {
120+
if value != math.Trunc(value) {
121121
return nil, ErrConvertingToYear.New("float64 value has a fractional component, cannot convert to int16")
122122
}
123123
return int16(value), nil

0 commit comments

Comments
 (0)