From 9981db93e675e80b09b9536ce1d773fd7368945c Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Mon, 29 Jul 2024 01:09:34 -0500 Subject: [PATCH] chore: Return empty string on error --- cmd/cmd.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index a9ac341..254c269 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -212,7 +212,7 @@ func templateReader(conf *config.Config, path string, r io.Reader, size int64) ( if errors.Is(err, io.EOF) { break } - return buf.String(), err + return "", err } if buf.Len() > 0 { @@ -220,18 +220,18 @@ func templateReader(conf *config.Config, path string, r io.Reader, size int64) ( } if err := v.Run(&n); err != nil { - return buf.String(), err + return "", err } encoder := yaml.NewEncoder(&buf) encoder.SetIndent(conf.Indent) if err := encoder.Encode(&n); err != nil { _ = encoder.Close() - return buf.String(), err + return "", err } if err := encoder.Close(); err != nil { - return buf.String(), err + return "", err } }