1## Setup 2SHELL := /bin/bash 3SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*") 4 5setup: 6 go get -u golang.org/lint/golint 7 go get github.com/Songmu/make2help/cmd/make2help 8 9## Benchmark 10profile: 11 go test -tags=sfdebug -v -run none -bench . -benchtime 3s -benchmem -cpuprofile cpu.out -memprofile mem.out -stderrthreshold=INFO -vmodule=*=2 12 @echo "For CPU usage, run 'go tool pprof jsonresultset.test cpu.out'" 13 @echo "For Memory usage, run 'go tool pprof -alloc_space jsonresultset.test mem.out'" 14 15## Trace 16trace: 17 go test -trace trace.out 18 @echo "Run 'go tool trace jsonresultset.test trace.out'" 19 20## Lint 21lint: setup 22 go vet $(SRC) 23 for pkg in $$(go list ./... | grep -v vendor); do \ 24 golint -set_exit_status $$pkg || exit $$?; \ 25 done 26 27## Format source codes using gfmt 28fmt: setup 29 @gofmt -l -w $(SRC) 30 31## Show help 32help: 33 @make2help $(MAKEFILE_LIST) 34 35.PHONY: install run 36