unmarshal clones and merges the data argument on top of dst.
This method is rarely used directly by the users and it is most
commonly used in the autogenerated migrations.
To an extent it is similar to the JS native Object.assign
but the arguments are reversed and it invokes the Go standard
json.Marshal/Unmarshal methods under the hood.
The data argument could be anything serializable, usually a plain object (map).
The dst argument could be any pointer value, usually a model instance.
unmarshal clones and merges the data argument on top of dst.
This method is rarely used directly by the users and it is most commonly used in the autogenerated migrations.
To an extent it is similar to the JS native
Object.assignbut the arguments are reversed and it invokes the Go standardjson.Marshal/Unmarshalmethods under the hood.The data argument could be anything serializable, usually a plain object (map). The dst argument could be any pointer value, usually a model instance.
Example: