From 17eef7184c499b3d61f9e75543fc5a2c2a3c7fc8 Mon Sep 17 00:00:00 2001 From: Guillem Date: Tue, 27 Aug 2024 13:19:52 -0300 Subject: [PATCH] change bytes.Buffer for strings.Builder --- destination/config.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/destination/config.go b/destination/config.go index 4eb0eb2..0aacdfb 100644 --- a/destination/config.go +++ b/destination/config.go @@ -17,7 +17,6 @@ package destination import ( - "bytes" "errors" "fmt" "regexp" @@ -143,13 +142,13 @@ func (c Config) ParseTopic() (topic string, f TopicFn, err error) { } // The topic is a valid template, return TopicFn. - var buf bytes.Buffer + var sb strings.Builder return "", func(r opencdc.Record) (string, error) { - buf.Reset() - if err := t.Execute(&buf, r); err != nil { + sb.Reset() + if err := t.Execute(&sb, r); err != nil { return "", fmt.Errorf("failed to execute topic template: %w", err) } - topic := buf.String() + topic := sb.String() if topic == "" { return "", fmt.Errorf( "topic not found on record %s using template %s",