From b0fb9ad623ec63fb9acc46add53dd32ed9724dcf Mon Sep 17 00:00:00 2001 From: Jaz Date: Mon, 5 Feb 2024 10:10:58 -0500 Subject: [PATCH] return errs --- .../launchdarkly/ld-find-code-refs/v2/search/files.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vendor/github.com/launchdarkly/ld-find-code-refs/v2/search/files.go b/vendor/github.com/launchdarkly/ld-find-code-refs/v2/search/files.go index 50011962..588ca9fe 100644 --- a/vendor/github.com/launchdarkly/ld-find-code-refs/v2/search/files.go +++ b/vendor/github.com/launchdarkly/ld-find-code-refs/v2/search/files.go @@ -73,10 +73,13 @@ func readFiles(ctx context.Context, files chan<- file, workspace string) error { readFile := func(path string, info os.FileInfo, err error) error { // TODO - fmt.Printf("Reading file: %s", path) - if err != nil || ctx.Err() != nil { + fmt.Printf("Reading file: %s\n", path) + if err != nil { + return err + } + if err := ctx.Err(); err != nil { // global context cancelled, don't read any more files - return nil + return err } isDir := info.IsDir()