# Makefile

  1. We recommend creating a Makefile in every project, with unified commands make dev, make test.
  2. Makefile is a recommended file name.
  3. Target name separated by -, e.g., run-tests. Begin with the verb: apply-, create-, install-.
  4. We write environment variables in uppercase, e.g., PROJECT_PATH.
  5. Local variables in bottomcase with _ delimiter, e.g., build_dir = $(PROJECT_PATH)/build.
  6. Add make help command:
help:  ## Display this help
    @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

test:  ## Run tests
    go test ./..
Last Updated: 10/22/2021, 12:25:34 PM