From b82f6c60b21306577864c08097bd3983bf28fda2 Mon Sep 17 00:00:00 2001 From: Sveinn Date: Mon, 30 Oct 2023 15:43:44 +0000 Subject: [PATCH] Removing un-used variables and fixing an error condition (#4737) --- cmd/client-fs.go | 2 +- cmd/cp-url.go | 4 ++-- cmd/tofu.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/client-fs.go b/cmd/client-fs.go index 690af68a..f36a4d28 100644 --- a/cmd/client-fs.go +++ b/cmd/client-fs.go @@ -881,7 +881,7 @@ func (f *fsClient) listInRoutine(contentCh chan<- *ClientContent) { switch fst.Mode().IsDir() { case true: files, e := readDir(fpath) - if err != nil { + if e != nil { contentCh <- &ClientContent{Err: probe.NewError(e)} return } diff --git a/cmd/cp-url.go b/cmd/cp-url.go index 6c0196e0..cdf363c3 100644 --- a/cmd/cp-url.go +++ b/cmd/cp-url.go @@ -285,7 +285,7 @@ func prepareCopyURLsTypeD(ctx context.Context, cc copyURLsContent, o prepareCopy } }(ctx, cc, o) - go func(ctx context.Context, cc copyURLsContent, o prepareCopyURLsOpts) { + go func() { defer close(copyURLsCh) filter := make(map[string]struct{}) for cpURLs := range copyURLsFilterCh { @@ -301,7 +301,7 @@ func prepareCopyURLsTypeD(ctx context.Context, cc copyURLsContent, o prepareCopy copyURLsCh <- cpURLs } } - }(ctx, cc, o) + }() return copyURLsCh } diff --git a/cmd/tofu.go b/cmd/tofu.go index 817a4456..73f42d6a 100644 --- a/cmd/tofu.go +++ b/cmd/tofu.go @@ -102,7 +102,7 @@ func promptTrustSelfSignedCert(ctx context.Context, endpoint, alias string) (*x5 return nil, nil } - if te != nil && !strings.Contains(te.Error(), "certificate signed by unknown authority") && + if !strings.Contains(te.Error(), "certificate signed by unknown authority") && !strings.Contains(te.Error(), "certificate is not trusted") /* darwin specific error message */ { return nil, probe.NewError(te) }