mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Merge pull request #47331 from wasylkowski/fix-gofmt
Automatic merge from submit-queue Fixed the issue with formatting issues not being reported when verification fails **What this PR does / why we need it**: **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
e626d381fb
@ -48,7 +48,11 @@ find_files() {
|
||||
\) -name '*.go'
|
||||
}
|
||||
|
||||
diff=$(find_files | xargs ${gofmt} -d -s 2>&1)
|
||||
# gofmt exits with non-zero exit code if it finds a problem unrelated to
|
||||
# formatting (e.g., a file does not parse correctly). Without "|| true" this
|
||||
# would have led to no useful error message from gofmt, because the script would
|
||||
# have failed before getting to the "echo" in the block below.
|
||||
diff=$(find_files | xargs ${gofmt} -d -s 2>&1) || true
|
||||
if [[ -n "${diff}" ]]; then
|
||||
echo "${diff}"
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user