From 9914f51140aadcb4cdeaa5db14ea8ada7474b6f0 Mon Sep 17 00:00:00 2001 From: lew Date: Sat, 14 Feb 2026 01:41:40 +0000 Subject: [PATCH] fix(get): prevents templating invalid utf8 values --- cmd/get.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/get.go b/cmd/get.go index e4b6b1c..ff1f5a8 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -29,6 +29,7 @@ import ( "os/exec" "strings" "text/template" + "unicode/utf8" "github.com/spf13/cobra" ) @@ -117,7 +118,7 @@ func get(cmd *cobra.Command, args []string) error { return fmt.Errorf("cannot get '%s': %v", args[0], err) } - if !noTemplate { + if !noTemplate && utf8.Valid(v) { var substitutions []string if len(args) > 1 { substitutions = args[1:]