From 74e7ef445183ef2b3ad6c99bc6367f2f3191fa56 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 31 Jul 2025 21:20:12 +0100 Subject: [PATCH] Return errors --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index beb742f..edc28dc 100644 --- a/main.go +++ b/main.go @@ -52,10 +52,10 @@ func findRepositoriesInDirectory(dir string) (string, error) { if exitErr, ok := err.(*exec.ExitError); ok { exitCode := exitErr.ExitCode() - fmt.Printf("Command failed with exit code %d\n", exitCode) + return "", fmt.Errorf("Command failed with exit code %d\n", exitCode) } - fmt.Printf("find failed on %s: %v\nOutput: %s\n", dir, err, string(output)) + return "", fmt.Errorf("find failed on %s: %w\nOutput: %s", dir, err, string(output)) } return string(output), nil