Regression in datatypes/json v1.0.4 with empty or nil values
f-blass opened this issue · 1 comments
f-blass commented
GORM Playground Link
Description
With https://github.com/go-gorm/datatypes@v1.0.4 JSON values have unexpected behaviours when nil or empty.
If the datatypes.JSON var is nil
, GORM will now insert a string "null"
into the database instead of an actual null
value.
If the datatypes.JSON var is empty (empty byte array) GORM tries to insert an empty string ""
, which fails.
bestgopher commented
fix it please @jinzhu