From 9c6edc7fd82f6b3aa1d4d6ee767fd4d2a30a8949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Tue, 2 Aug 2022 12:54:17 +0200 Subject: [PATCH] Revert record value counter change requiring module The change breaks tests which use the older, "simpler" interface. --- compose/types/record.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/compose/types/record.go b/compose/types/record.go index 97aaa6b8f..520cd0cb9 100644 --- a/compose/types/record.go +++ b/compose/types/record.go @@ -241,14 +241,16 @@ func (r *Record) CountValues() (pos map[string]uint) { "ownedBy": 1, } - if mod == nil { - // count record values - // only when module is known - return - } + // if mod == nil { + // // count record values + // // only when module is known + // return + // } - for _, f := range mod.Fields { - pos[f.Name] = 0 + if mod != nil { + for _, f := range mod.Fields { + pos[f.Name] = 0 + } } for _, val := range r.Values {