瀏覽代碼

Merge pull request #842 from gocql/Zariel-patch-1

marshalUDT: allow not using all the UDT fields
Chris Bannister 9 年之前
父節點
當前提交
db6f35eb60
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      marshal.go

+ 1 - 1
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)