by narven · 6y ago · 0 comments
Another thing you can add is:
.DEFAULT_GOAL := start
start: fmt swag vet build run
Helps define you default command soyou just need to run `make` and will run all inside of `start`
Since most of us use `.env` files for enviroment files, you can use something like:
# this allows to import into this file all current system envs
include .env
export
And it will inject all of .env file into the current running `process`
Also have some other shortcuts (variables):
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOFMT=gofmt -w
GOGET=$(GOCMD) mod download
GOVER=$(COCMD) vet
GOFILES=$(shell find . -name "*.go" -type f)
BINARY_NAME=my-cool-project
BINARY_UNIX=$(BINARY_NAME)_prod
No comments yet.