#!/bin/sh set -eu lintversion=1.25.1 cd "$(pwd -P)" bindir=$( cd "${0%/*}" && pwd ) rootdir=$( cd "$bindir"/.. && pwd ) targetbin=$rootdir/target/bin cd "$rootdir" os=linux exe= if [ "$(uname -s)" = Darwin ]; then os=darwin elif [ "$(uname -o)" = Msys ]; then os=windows exe=.exe fi lintbin=$targetbin/.golangci-lint-$lintversion$exe if [ ! -f "$lintbin" ]; then mkdir -p "$targetbin" curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/v$lintversion/install.sh | sh -s -- -b . v$lintversion mv ./golangci-lint$exe "$lintbin" fi "$lintbin" run "$@"