Teach it about golang
This commit is contained in:
@@ -42,6 +42,22 @@ elif [[ $file_type == "python" ]]; then
|
||||
else
|
||||
retval="$isort_retval"
|
||||
fi
|
||||
elif [[ $file_type == "golang" ]] ; then
|
||||
success_retval=0
|
||||
would_reformat_retval=1
|
||||
syntax_error_retval=2
|
||||
|
||||
out=$(gofmt -l $file)
|
||||
exitval="$?"
|
||||
|
||||
if [[ x"$exitval" = x"$syntax_error_retval" ]] ; then
|
||||
retval="$exitval"
|
||||
elif [[ x"$out" = x"$file" ]] ; then
|
||||
retval="$would_reformat_retval"
|
||||
else
|
||||
# success
|
||||
retval="$exitval"
|
||||
fi
|
||||
else
|
||||
echo -n "ignoring"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user