bench/generator-go

View on GitHub
app/templates/_Makefile

Summary

Maintainability
Test Coverage
# VARIABLES
PACKAGE="<%=moduleName%>"

default: usage

clean: ## Trash binary files
    @echo "--> cleaning..."
    @go clean || (echo "Unable to clean project" && exit 1)
    @echo "Clean OK"

test: ## Run all tests
    @echo "--> testing..."
    @go test -v $(PACKAGE)/...

install: clean ## Compile sources and build binary
    @echo "--> installing..."
    @go install $(PACKAGE) || (echo "Compilation error" && exit 1)
    @echo "Install OK"

run: install ## Run your application
    @echo "--> running application..."
    @go run main.go

usage: ## List available targets
    @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'