Skip to content

Commit

Permalink
Update targets
Browse files Browse the repository at this point in the history
  • Loading branch information
vancanhuit committed Jun 22, 2022
1 parent 0c6f172 commit 9f833b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

bin/
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
## help: print this help message
SHELL=/bin/bash -e -o pipefail
PWD = $(shell pwd)

## help: Print this help message
.PHONY: help
help:
@echo "Usage:"
@sed -n 's/^##//p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'

## test: run tests
## test: Run tests
.PHONY: test
test:
go test -v ./...

## race: run tests with race detector
.PHONY: race
race:
go test -race -v ./...

## cover: Run tests and show coverage result
.PHONY: cover
cover:
go test -v -coverprofile=coverage.out ./...
go tool cover -func=coverage.out

## tidy: Cleanup and download missing dependencies
.PHONY: tidy
tidy:
Expand All @@ -29,3 +33,8 @@ vet:
.PHONY: fmt
fmt:
go fmt ./...

## build: Build binary into bin/ directory
.PHONY: build
build:
go build -ldflags="-w -s" -o bin/app ./...

0 comments on commit 9f833b1

Please sign in to comment.