mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
7d2130141b
Also fix the comment in checkstyle-go.sh, it got the behavior of go{imports fmt} -d the other way around.
16 lines
380 B
Bash
Executable File
16 lines
380 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
# Check if the style of the Go source files is correct without modifying those
|
|
# files.
|
|
|
|
# The grep is needed because `goimports -d` and `gofmt -d` always exits with 0.
|
|
|
|
echo 'Go files need these changes:'
|
|
if find . -name '*.go' | xargs goimports -d | grep .; then
|
|
exit 1
|
|
fi
|
|
if find . -name '*.go' | xargs gofmt -s -d | grep .; then
|
|
exit 1
|
|
fi
|
|
echo ' None!'
|