From ae674a3660ff7655c9b79bf0c01af0a363efdf4d Mon Sep 17 00:00:00 2001 From: Hyung-Kyu Hqueue Choi <9247907+hqueue@users.noreply.github.com> Date: Tue, 24 Jul 2018 09:11:51 +0900 Subject: Makefile: clean go build cache (#17079) --- build/clean_go_build_cache.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 build/clean_go_build_cache.sh (limited to 'build/clean_go_build_cache.sh') 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 -- cgit v1.2.3