sql: Scan error on column index 26, name "xx": converting NULL to string is unsupported
Can the field value of null in mysql be automatically converted to an empty string instead of reporting an error?
@jiankunking to work with null value you need to use a pointer type. In your case it's *string.
There is no magic type conversion in Go. Null and empty string are not the same values.
I feel it is a good idea to convert null to empty string in unsafe mode.
A workaround is using IFNULL(expr1, expr2) supported by mysql
you can use this tool : https://github.com/jtao539/sqlxp
i am facing the same error, if it is the point then why the code is working before hours ??
i just found the solution, error was that some how i post the {Null}, where i need to post Null string type so if you are facing this error go check your sql db and delete the particular column where {null} is stored