File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ git-ref.txt
Original file line number Diff line number Diff line change
1
+ TEST? =$$(go list ./... |grep -v 'vendor' )
2
+ GOFMT_FILES? =$$(find . -name '*.go' |grep -v vendor )
3
+ PKG_NAME =glectl
4
+
5
+ default : build
6
+
7
+ build : fmtcheck
8
+ $(shell ./scripts/get_gitref.sh > helpers/git-ref.txt)
9
+ @go build
10
+
11
+ install :
12
+ go install
13
+
14
+ test : fmtcheck
15
+ go test $(TEST ) || exit 1
16
+ echo $(TEST ) | \
17
+ xargs -t -n4 go test $(TESTARGS ) -timeout=30s -parallel=4
18
+
19
+ vet :
20
+ @echo " go vet ."
21
+ @go vet $$(go list ./... | grep -v vendor/ ) ; if [ $$ ? -eq 1 ]; then \
22
+ echo " " ; \
23
+ echo " Vet found suspicious constructs. Please check the reported constructs" ; \
24
+ echo " and fix them if necessary before submitting the code for review." ; \
25
+ exit 1; \
26
+ fi
27
+
28
+ fmt :
29
+ gofmt -w $(GOFMT_FILES )
30
+
31
+ fmtcheck :
32
+ @sh -c " '$( CURDIR) /scripts/gofmtcheck.sh'"
33
+
34
+ test-compile :
35
+ @if [ " $( TEST) " = " ./..." ]; then \
36
+ echo " ERROR: Set TEST to a specific package. For example," ; \
37
+ echo " make test-compile TEST=./$( PKG_NAME) " ; \
38
+ exit 1; \
39
+ fi
40
+ go test -c $(TEST ) $(TESTARGS )
41
+
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ git rev-parse --short HEAD
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Check gofmt
4
+ echo " ==> Checking that code complies with gofmt requirements..."
5
+ gofmt_files=$( gofmt -l ` find . -name ' *.go' | grep -v vendor` )
6
+ if [[ -n ${gofmt_files} ]]; then
7
+ echo ' gofmt needs running on the following files:'
8
+ echo " ${gofmt_files} "
9
+ echo " You can use the command: \` make fmt\` to reformat code."
10
+ exit 1
11
+ fi
12
+
13
+ exit 0
You can’t perform that action at this time.
0 commit comments