database/sql/driver: convertAssignRows not all nilPtr destinations covered in the switch cases #66237
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
latest
Output of
go env
in your module/workspace:What did you do?
I was reading through the source code of database/sql/driver to learn to write better go and out of interest how a language is designed.
What did you see happen?
I suspect no errNilPtr will be returned in
https://github.com/golang/go/blob/master/src/database/sql/convert.go#L272-L278
To confirm this i didn't see any tests for the returning of a nilptr err.
What did you expect to see?
Since dest has to be pointer it would be best to first test if the dest is a nil ptr at the top level of the function.
https://github.com/golang/go/blob/master/src/database/sql/convert.go#L219-L221
The text was updated successfully, but these errors were encountered: