Upgrade go version to 1.18 (#5045)

* Upgrade go version to 1.18

* fix go 1.18 compatibility

* update gofmt

* ignore golangci-lint staticcheck

* update gofmt
This commit is contained in:
hongming
2022-07-18 10:42:48 +08:00
committed by GitHub
parent e529703c49
commit 521cb40c21
872 changed files with 109434 additions and 111219 deletions

View File

@@ -69,7 +69,7 @@ done < <(find . -name "*.sh" \
-path ./_\* -o \
-path ./.git\* -o \
-path ./vendor\* -o \
-path ./hack/install_kubebuilder.sh -o \
-path ./LICENSES\* -o \
\( -path ./third_party\* -a -not -path ./third_party/forked\* \) \
\))
@@ -103,16 +103,18 @@ SHELLCHECK_OPTIONS=(
)
# tell the user which we've selected and lint all scripts
# The shellcheck errors are printed to stdout by default, hence they need to be redirected
# to stderr in order to be well parsed for Junit representation by juLog function
res=0
if ${HAVE_SHELLCHECK}; then
echo "Using host shellcheck ${SHELLCHECK_VERSION} binary."
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" || res=$?
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" >&2 || res=$?
else
echo "Using shellcheck ${SHELLCHECK_VERSION} docker image."
"${DOCKER}" run \
--rm -v "${KUBE_ROOT}:${KUBE_ROOT}" -w "${KUBE_ROOT}" \
"${SHELLCHECK_IMAGE}" \
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" || res=$?
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" >&2 || res=$?
fi
# print a message based on the result
@@ -133,4 +135,4 @@ else
fi
# preserve the result
exit $res
exit $res