From 4e8e3dad863fc18fc15a56f9f1a2756970048ca0 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Wed, 4 Feb 2015 09:25:45 -0600 Subject: [PATCH] DiffFieldReader: filter all '#' fields from sets Now that readMap filters out '#' fields, when maps are nested in sets, we exposed a related bug where a set was iterating over nested maps and expected the '#' key to be present in those nested maps. By skipping _all_ count fields when iterating over set keys, all is right with the world again. --- helper/schema/field_reader_diff.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helper/schema/field_reader_diff.go b/helper/schema/field_reader_diff.go index 378909fd3f..ec875421bb 100644 --- a/helper/schema/field_reader_diff.go +++ b/helper/schema/field_reader_diff.go @@ -153,8 +153,8 @@ func (r *DiffFieldReader) readSet( if !strings.HasPrefix(k, prefix) { continue } - if strings.HasPrefix(k, prefix+"#") { - // Ignore the count field + if strings.HasSuffix(k, "#") { + // Ignore any count field continue }