mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 03:35:22 +00:00
Merge pull request #6295 from kaovilai/speedup-fmt
Speedup update-1fmt.sh by removing xargs, printf.
This commit is contained in:
@@ -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/*')"
|
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"
|
echo "${ACTION} gofmt"
|
||||||
output=$(printf '%s\n' "${files}" | xargs gofmt "${MODE}" -s)
|
output=$(gofmt "${MODE}" -s ${files})
|
||||||
if [[ -n "${output}" ]]; then
|
if [[ -n "${output}" ]]; then
|
||||||
VERIFY_FMT_FAILED=1
|
VERIFY_FMT_FAILED=1
|
||||||
echo "${output}"
|
echo "${output}"
|
||||||
@@ -47,7 +47,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${ACTION} goimports"
|
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
|
if [[ -n "${output}" ]]; then
|
||||||
VERIFY_IMPORTS_FAILED=1
|
VERIFY_IMPORTS_FAILED=1
|
||||||
echo "${output}"
|
echo "${output}"
|
||||||
|
|||||||
Reference in New Issue
Block a user