Skip to content

Commit

Permalink
Merge pull request #13 from rog-golang-buddies/add-makefile
Browse files Browse the repository at this point in the history
Add initial makefile
  • Loading branch information
shukra-in-spirit authored Jun 29, 2022
2 parents 319e7b0 + 2fa5291 commit c0566ca
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ tab_width = 4
[*.go]
indent_style = tab

[Makefile]
indent_style = tab

[*.{yaml,yml}]
indent_size = 2
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/
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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
.PHONY: test
test:
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:
go mod tidy
go mod verify

## vet: Examine Go source code and reports suspicious constructs
.PHONY: vet
vet:
go vet ./...

## fmt: Format all go source files
.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 c0566ca

Please sign in to comment.