Skip to content

Instantly share code, notes, and snippets.

@shootacean
Last active August 5, 2019 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shootacean/c73052bd42d0d8f664722fec1b7e7e4b to your computer and use it in GitHub Desktop.
Save shootacean/c73052bd42d0d8f664722fec1b7e7e4b to your computer and use it in GitHub Desktop.
go makefile quick Start
# ref: https://frasco.io/golang-dont-afraid-of-makefiles-785f3ec7eb32
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build
lint:
$(GOCMD) vet ./...; golint -min_confidence=0 ./...
build:
$(GOBUILD) -o $(BINARY_NAME) -v
test:
$(GOTEST) -v ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment