diff options
| author | Xiang Dai <long0dai@foxmail.com> | 2020-05-11 10:37:33 +0800 |
|---|---|---|
| committer | Xiang Dai <long0dai@foxmail.com> | 2020-06-04 10:27:54 +0800 |
| commit | 1d770c11d03ea1985e61575cba5c83d2a9ca5623 (patch) | |
| tree | 9743e2159d6cbf68e3f1203e1a5e6bf5e9ed91dd /hack/lib/golang.sh | |
| parent | Merge pull request #1746 from daixiang0/cache (diff) | |
| download | kubeedge-1d770c11d03ea1985e61575cba5c83d2a9ca5623.tar.gz | |
Lint: cleanup white noise
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Diffstat (limited to 'hack/lib/golang.sh')
| -rw-r--r-- | hack/lib/golang.sh | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 0c51e83f3..8a9a13fb7 100644 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -19,7 +19,6 @@ # KubeEdge Authors: # To Get Detail Version Info for KubeEdge Project -#set -x set -o errexit set -o nounset set -o pipefail @@ -136,7 +135,7 @@ kubeedge::check::env() { errors+="GOPATH environment value not set" fi - # check other env + # check other env # check lenth of errors if [[ ${#errors[@]} -ne 0 ]] ; then @@ -178,7 +177,7 @@ kubeedge::golang::get_all_targets() { } kubeedge::golang::get_all_binares() { - local -a binares + local -a binares for bt in "${ALL_BINARIES_AND_TARGETS[@]}" ; do binares+=("${bt%%:*}") done @@ -195,11 +194,11 @@ kubeedge::golang::build_binaries() { for binArg in "$@"; do targets+=("$(kubeedge::golang::get_target_by_binary $binArg)") done - + if [[ ${#targets[@]} -eq 0 ]]; then targets=("${KUBEEDGE_ALL_TARGETS[@]}") fi - + local -a binaries while IFS="" read -r binary; do binaries+=("$binary"); done < <(kubeedge::golang::binaries_from_targets "${targets[@]}") @@ -227,11 +226,11 @@ kubeedge::golang::is_cross_build_binary() { local key=$1 for bin in "${KUBEEDGE_ALL_CROSS_BINARIES[@]}" ; do if [ "${bin}" == "${key}" ]; then - echo ${YES} + echo ${YES} return fi done - echo ${NO} + echo ${NO} } KUBEEDGE_ALL_CROSS_GOARMS=( @@ -243,17 +242,16 @@ kubeedge::golang::is_supported_goarm() { local key=$1 for value in ${KUBEEDGE_ALL_CROSS_GOARMS[@]} ; do if [ "${value}" == "${key}" ]; then - echo ${YES} + echo ${YES} return fi done - echo ${NO} + echo ${NO} } kubeedge::golang::cross_build_place_binaries() { kubeedge::check::env - - set -x + local -a targets=() local goarm=${goarm:-${KUBEEDGE_ALL_CROSS_GOARMS[0]}} @@ -275,10 +273,10 @@ kubeedge::golang::cross_build_place_binaries() { targets+=("$(kubeedge::golang::get_target_by_binary $bin)") done fi - + if [ "$(kubeedge::golang::is_supported_goarm ${goarm})" == "${NO}" ]; then echo "GOARM${goarm} does not support cross build" - exit 1 + exit 1 fi local -a binaries @@ -312,11 +310,11 @@ kubeedge::golang::is_small_build_binary() { local key=$1 for bin in "${KUBEEDGE_ALL_SMALL_BINARIES[@]}" ; do if [ "${bin}" == "${key}" ]; then - echo ${YES} + echo ${YES} return fi done - echo ${NO} + echo ${NO} } kubeedge::golang::small_build_place_binaries() { @@ -336,7 +334,7 @@ kubeedge::golang::small_build_place_binaries() { targets+=("$(kubeedge::golang::get_target_by_binary $bin)") done fi - + local -a binaries while IFS="" read -r binary; do binaries+=("$binary"); done < <(kubeedge::golang::binaries_from_targets "${targets[@]}") |
