Skip to content

Instantly share code, notes, and snippets.

@unknowntpo
Created May 2, 2023 00:09
Show Gist options
  • Save unknowntpo/63dbacfe49d04f542d9a348604604261 to your computer and use it in GitHub Desktop.
Save unknowntpo/63dbacfe49d04f542d9a348604604261 to your computer and use it in GitHub Desktop.
Common Makefile with help message
all: help
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## mock/gen: generate mock $(IFASE) implementation against interface inside internal/domain, e.g. make mock/gen IFASE=PageUsecase
.PHONY: mock/gen
mock/gen:
mockgen -source ./domain/page.go \
-destination ./domain/mock/$(IFASE).go \
-package mock \
$(IFASE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment