diff options
author | Hyung-Kyu Hqueue Choi <9247907+hqueue@users.noreply.github.com> | 2018-07-24 08:11:51 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-07-24 08:11:51 +0800 |
commit | ae674a3660ff7655c9b79bf0c01af0a363efdf4d (patch) | |
tree | 47d30f7f8de130012948c88617b3e701810d698b /build | |
parent | 894022a3d5b2aba7714eb8fad3fbba0e0b5b74ea (diff) | |
download | dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.tar dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.tar.gz dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.tar.bz2 dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.tar.lz dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.tar.xz dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.tar.zst dexon-ae674a3660ff7655c9b79bf0c01af0a363efdf4d.zip |
Makefile: clean go build cache (#17079)
Diffstat (limited to 'build')
-rwxr-xr-x | build/clean_go_build_cache.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/build/clean_go_build_cache.sh b/build/clean_go_build_cache.sh new file mode 100755 index 000000000..e6a523fb4 --- /dev/null +++ b/build/clean_go_build_cache.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +function version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } + +golang_version=$(go version |cut -d' ' -f3 |sed 's/go//') + +# Clean go build cache when go version is greater than or equal to 1.10 +if !(version_gt 1.10 $golang_version); then + go clean -cache +fi |