worryg0d commented on code in PR #1939:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1939#discussion_r3021090896
##########
marshal.go:
##########
@@ -2923,9 +2923,13 @@ func (udt UDTTypeInfo) Marshal(value interface{})
([]byte, error) {
func (udt UDTTypeInfo) Unmarshal(data []byte, value interface{}) error {
// do this up here so we don't need to duplicate all of the map logic
below
if iptr, ok := value.(*interface{}); ok && iptr != nil {
- v := map[string]interface{}{}
- *iptr = v
+ var v map[string]interface{}
value = &v
+ // Deffering this to the end of the method so dst var will hold
updated map value
+ //
https://issues.apache.org/jira/projects/CASSGO/issues/CASSGO-115
+ defer func() {
+ *iptr = v
+ }()
}
Review Comment:
Updated patch - now there is an unmarshalIntoMap method, which is called for
both *map[string]interface{} and *interface{} cases
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]