Skip to content

Commit aa48110

Browse files
committed
fix: handler "Error return value of binary.Write is not checked"
1 parent fe07a17 commit aa48110

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mysql/resultset_helper.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ func toBinaryDateTime(t time.Time) ([]byte, error) {
2424

2525
if nanosec > 0 {
2626
buf.WriteByte(byte(11))
27-
binary.Write(&buf, binary.LittleEndian, uint16(year))
27+
_ = binary.Write(&buf, binary.LittleEndian, uint16(year))
2828
buf.WriteByte(byte(month))
2929
buf.WriteByte(byte(day))
3030
buf.WriteByte(byte(hour))
3131
buf.WriteByte(byte(min))
3232
buf.WriteByte(byte(sec))
33-
binary.Write(&buf, binary.LittleEndian, uint32(nanosec/1000))
33+
_ = binary.Write(&buf, binary.LittleEndian, uint32(nanosec/1000))
3434
} else if hour > 0 || min > 0 || sec > 0 {
3535
buf.WriteByte(byte(7))
36-
binary.Write(&buf, binary.LittleEndian, uint16(year))
36+
_ = binary.Write(&buf, binary.LittleEndian, uint16(year))
3737
buf.WriteByte(byte(month))
3838
buf.WriteByte(byte(day))
3939
buf.WriteByte(byte(hour))
4040
buf.WriteByte(byte(min))
4141
buf.WriteByte(byte(sec))
4242
} else {
4343
buf.WriteByte(byte(4))
44-
binary.Write(&buf, binary.LittleEndian, uint16(year))
44+
_ = binary.Write(&buf, binary.LittleEndian, uint16(year))
4545
buf.WriteByte(byte(month))
4646
buf.WriteByte(byte(day))
4747
}

0 commit comments

Comments
 (0)