From 785e1aa5d330fe0343d4876f79bb778561534f23 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Fri, 19 May 2023 11:46:44 -0400 Subject: [PATCH 1/2] Speedup update-1fmt.sh by removing xargs, printf. Signed-off-by: Tiger Kaovilai --- hack/update-1fmt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/update-1fmt.sh b/hack/update-1fmt.sh index fef575451..204801bdf 100755 --- a/hack/update-1fmt.sh +++ b/hack/update-1fmt.sh @@ -35,7 +35,7 @@ fi files="$(find . -type f -name '*.go' -not -path './.go/*' -not -path './vendor/*' -not -path './site/*' -not -path '*/generated/*' -not -name 'zz_generated*' -not -path '*/mocks/*')" echo "${ACTION} gofmt" -output=$(printf '%s\n' "${files}" | xargs gofmt "${MODE}" -s) +output=$(gofmt "${MODE}" -s ${files}) if [[ -n "${output}" ]]; then VERIFY_FMT_FAILED=1 echo "${output}" @@ -47,7 +47,7 @@ else fi echo "${ACTION} goimports" -output=$(printf '%s\n' "${files}" | xargs goimports "${MODE}" -local github.com/vmware-tanzu/velero) +output=$(goimports "${MODE}" -local github.com/vmware-tanzu/velero ${files}) if [[ -n "${output}" ]]; then VERIFY_IMPORTS_FAILED=1 echo "${output}" From a845ea4d57d4b31a9090afe60387bbbddab3e34e Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Fri, 19 May 2023 12:37:23 -0400 Subject: [PATCH 2/2] lint: pkg/backup/backup_pv_action.go:79: unnecessary trailing newline (whitespace) Signed-off-by: Tiger Kaovilai --- pkg/backup/backup_pv_action.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/backup/backup_pv_action.go b/pkg/backup/backup_pv_action.go index e11598809..56c4fff8a 100644 --- a/pkg/backup/backup_pv_action.go +++ b/pkg/backup/backup_pv_action.go @@ -76,5 +76,4 @@ func (a *PVCAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runti } return &unstructured.Unstructured{Object: pvcMap}, []velero.ResourceIdentifier{pv}, nil - }