aboutsummaryrefslogtreecommitdiffstats
path: root/commands/execenv/env_testing.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2023-01-03 08:37:21 -0500
committerSteve Moyer <smoyer1@selesy.com>2023-01-03 08:37:21 -0500
commit7601e79d2b60315e259f36e96d7bfdcc92d3fcba (patch)
treee84c2c8f33d7610ea83da9a8c2ed774a8da0fa48 /commands/execenv/env_testing.go
parent344438b9cb216dd878221600071d3ac8093ad34b (diff)
parent3915d2b76e17ae7058510d3b4cd91b24786bb526 (diff)
downloadgit-bug-7601e79d2b60315e259f36e96d7bfdcc92d3fcba.tar.gz
deps: fix merge conflicts in dependencies
Diffstat (limited to 'commands/execenv/env_testing.go')
-rw-r--r--commands/execenv/env_testing.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/commands/execenv/env_testing.go b/commands/execenv/env_testing.go
index 5761b410..34eafc9c 100644
--- a/commands/execenv/env_testing.go
+++ b/commands/execenv/env_testing.go
@@ -2,6 +2,7 @@ package execenv
import (
"bytes"
+ "encoding/json"
"fmt"
"testing"
@@ -27,6 +28,15 @@ func (te *TestOut) Println(a ...interface{}) {
_, _ = fmt.Fprintln(te.Buffer, a...)
}
+func (te *TestOut) PrintJSON(v interface{}) error {
+ raw, err := json.MarshalIndent(v, "", " ")
+ if err != nil {
+ return err
+ }
+ te.Println(string(raw))
+ return nil
+}
+
func NewTestEnv(t *testing.T) *Env {
t.Helper()