|
|
@ -1,17 +1,5 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
# Print a file surrounded by BEGIN/END preamble, e.g.: |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# --- BEGIN a.out output --- |
|
|
|
|
|
|
|
# Hello world |
|
|
|
|
|
|
|
# --- END a.out output --- |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
print_file() { |
|
|
|
|
|
|
|
echo "--- BEGIN ${2} ---" |
|
|
|
|
|
|
|
cat "${1}" |
|
|
|
|
|
|
|
echo "--- END ${2} ---" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unset -v ok tmpdir go_files go_dirs goimports_output golint_output progdir |
|
|
|
unset -v ok tmpdir go_files go_dirs goimports_output golint_output progdir |
|
|
|
ok=true |
|
|
|
ok=true |
|
|
|
|
|
|
|
|
|
|
@ -60,7 +48,7 @@ then |
|
|
|
echo "golint passed." |
|
|
|
echo "golint passed." |
|
|
|
else |
|
|
|
else |
|
|
|
echo "golint FAILED!" |
|
|
|
echo "golint FAILED!" |
|
|
|
print_file "${golint_output}" "golint" |
|
|
|
"${progdir}/print_file.sh" "${golint_output}" "golint" |
|
|
|
ok=false |
|
|
|
ok=false |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
@ -70,7 +58,7 @@ xargs goimports -d -e < "${go_files}" > "${goimports_output}" 2>&1 |
|
|
|
if [ -s "${goimports_output}" ] |
|
|
|
if [ -s "${goimports_output}" ] |
|
|
|
then |
|
|
|
then |
|
|
|
echo "goimports FAILED!" |
|
|
|
echo "goimports FAILED!" |
|
|
|
print_file "${goimports_output}" "goimports" |
|
|
|
"${progdir}/print_file.sh" "${goimports_output}" "goimports" |
|
|
|
ok=false |
|
|
|
ok=false |
|
|
|
else |
|
|
|
else |
|
|
|
echo "goimports passed." |
|
|
|
echo "goimports passed." |
|
|
|