mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
15 lines
262 B
Bash
15 lines
262 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# exclude vendor/
|
||
|
SOURCES="*.go internal/ example/"
|
||
|
|
||
|
if [ "$1" = "--fix" ]; then
|
||
|
exec gofmt -s -w $SOURCES
|
||
|
fi
|
||
|
|
||
|
if [ -n "$(gofmt -s -l $SOURCES)" ]; then
|
||
|
echo "Go code is not formatted correctly with \`gofmt -s\`:"
|
||
|
gofmt -s -d $SOURCES
|
||
|
exit 1
|
||
|
fi
|