export PATH := $(CURDIR)/_tools/bin:$(PATH)

all: setup lint test

setup:
	GOPATH=$(CURDIR)/_tools go install all # build source files in _tools to _tools/bin
	go get -t ./...

test:
	go test -race -cover ./...

lint: setup
	gometalinter --enable-all --tests --disable=safesql --disable=test --disable=gotype --disable=gas --disable=testify --cyclo-over=11 --deadline=1m --disable=lll ./...
	# G104 is already checked through errcheck
	gas -fmt=csv -exclude=G104 ./*.go
