From 126034f0f6fb0615d51a72fae0f626e257301e98 Mon Sep 17 00:00:00 2001 From: vicky Date: Sat, 20 Mar 2021 15:06:48 +0530 Subject: [PATCH] - removed not used call of sval.String() from migrateEmailTemplates - Added pointer as second argument of Unmarshal call in MarshalYAML --- pkg/envoy/yaml/compose_module_marshal.go | 4 +++- pkg/provision/migrations_202103_templates.go | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/envoy/yaml/compose_module_marshal.go b/pkg/envoy/yaml/compose_module_marshal.go index 62fc0809f..6bd367f36 100644 --- a/pkg/envoy/yaml/compose_module_marshal.go +++ b/pkg/envoy/yaml/compose_module_marshal.go @@ -97,7 +97,9 @@ func (n *composeModule) Encode(ctx context.Context, doc *Document, state *envoy. func (c *composeModule) MarshalYAML() (interface{}, error) { // Get a struct from the raw JSON string auxMeta := make(map[string]interface{}) - json.Unmarshal(c.res.Meta, auxMeta) + if err := json.Unmarshal(c.res.Meta, &auxMeta); err != nil { + return nil, err + } nn, err := makeMap( "handle", c.res.Handle, diff --git a/pkg/provision/migrations_202103_templates.go b/pkg/provision/migrations_202103_templates.go index 83395df29..b3fad8e4f 100644 --- a/pkg/provision/migrations_202103_templates.go +++ b/pkg/provision/migrations_202103_templates.go @@ -81,7 +81,6 @@ func migrateEmailTemplates(ctx context.Context, log *zap.Logger, s store.Storer) continue } - sval.String() tmpl.ID = id.Next() tmpl.CreatedAt = time.Now() tmpl.Template = sval.String()