File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Script that checks up code (govet).
3+
4+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd -P) "
5+
6+ function print_real_go_files {
7+ grep --files-without-match ' DO NOT EDIT!' $( find . -iname ' *.go' )
8+ }
9+
10+ function govet_all {
11+ ret=0
12+ for i in $( print_real_go_files) ; do
13+ output=$( go tool vet -all=true -tests=false ${i} )
14+ ret=$(( $ret | $? ))
15+ echo -n ${output}
16+ done ;
17+ return ${ret}
18+ }
19+
20+ govet_all
21+ echo " returning $? "
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Script that checks the code for errors.
3+
4+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd -P) "
5+
6+ function print_real_go_files {
7+ grep --files-without-match ' DO NOT EDIT!' $( find . -iname ' *.go' )
8+ }
9+
10+ function generate_markdown {
11+ echo " Generating markdown"
12+ oldpwd=$( pwd)
13+ for i in $( find . -iname ' doc.go' ) ; do
14+ dir=${i%/* }
15+ echo " $dir "
16+ cd ${dir}
17+ ${GOPATH} /bin/godocdown -heading=Title -o DOC.md
18+ ln -s DOC.md README.md 2> /dev/null # can fail
19+ cd ${oldpwd}
20+ done ;
21+ }
22+
23+ function goimports_all {
24+ echo " Running goimports"
25+ goimports -l -w $( print_real_go_files)
26+ return $?
27+ }
28+
29+ generate_markdown
30+ goimports_all
31+ echo " returning $? "
You can’t perform that action at this time.
0 commit comments