From 2bcf64d3dddb6ce62959e3fd7a3ccc977c0de652 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Tue, 29 Nov 2016 18:44:24 +0000 Subject: [PATCH] marshalUDT: allow not using all the UDT fields When inserting a UDT via a map, allow the map to be a subset of the UDT. Fixes #841 --- marshal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marshal.go b/marshal.go index 2bfdfba48..111102610 100644 --- a/marshal.go +++ b/marshal.go @@ -1590,7 +1590,7 @@ func marshalUDT(info TypeInfo, value interface{}) ([]byte, error) { for _, e := range udt.Elements { val, ok := v[e.Name] if !ok { - return nil, marshalErrorf("missing UDT field in map: %s", e.Name) + continue } data, err := Marshal(e.Type, val)