2018-07-23 19:11:51 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-07-26 05:01:00 -05:00
|
|
|
version_gt() {
|
|
|
|
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"
|
|
|
|
}
|
2018-07-23 19:11:51 -05:00
|
|
|
|
|
|
|
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
|