2019-08-20 15:45:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-11-04 19:29:05 +02:00
|
|
|
if ! git diff --staged --name-only | grep -qE ".*\.go$|\.golangci\.yml$"; then
|
2019-09-11 13:25:57 +02:00
|
|
|
echo "Nothing to lint"
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
2019-08-20 16:26:55 +02:00
|
|
|
if [ -x "$(which brew)" ]; then
|
2019-08-20 15:45:52 +02:00
|
|
|
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix libffi)/lib/pkgconfig"
|
2023-11-25 19:42:54 +02:00
|
|
|
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix libarchive)/lib/pkgconfig"
|
2019-08-20 15:45:52 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
export CGO_LDFLAGS_ALLOW="-s|-w"
|
|
|
|
export CGO_CFLAGS_ALLOW="-Xpreprocessor"
|
|
|
|
|
2019-09-11 10:42:36 +02:00
|
|
|
golangci-lint run
|