From 7480409cc40eb41e2d2f1b6716ad565e65ee26f7 Mon Sep 17 00:00:00 2001 From: Peter Fern Date: Thu, 15 Jan 2015 16:15:50 +1100 Subject: [PATCH] Process pointer fields, rather than trying to walk them Pointers may be references to any type, existing logic will only handle types understood by `walkDocument`, instead pass the deref'd element to `processProperty`, where it can get passed back to `walkDocument` if necessary, or be processed as a regular field. --- mapping_document.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapping_document.go b/mapping_document.go index 604c1eb5..638735ee 100644 --- a/mapping_document.go +++ b/mapping_document.go @@ -251,7 +251,7 @@ func (dm *DocumentMapping) walkDocument(data interface{}, path []string, indexes case reflect.Ptr: ptrElem := val.Elem() if ptrElem.IsValid() && ptrElem.CanInterface() { - dm.walkDocument(ptrElem.Interface(), path, indexes, context) + dm.processProperty(ptrElem.Interface(), path, indexes, context) } } }