Skip to content

Instantly share code, notes, and snippets.

@madhums
Created August 5, 2015 20:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhums/45efcb78d5d0d654191f to your computer and use it in GitHub Desktop.
Save madhums/45efcb78d5d0d654191f to your computer and use it in GitHub Desktop.
Makefile for golang projects
.PHONY: build doc fmt lint dev test vet godep install bench
PKG_NAME=$(shell basename `pwd`)
install:
go get -t -v ./...
build: vet \
test \
go build -v -o ./bin/$(PKG_NAME)
doc:
godoc -http=:6060
fmt:
go fmt ./...
# https://github.com/golang/lint
# go get github.com/golang/lint/golint
lint:
golint ./...
dev:
DEBUG=* go get && go install && gin -p 8911 -i
test:
go test ./...
# Runs benchmarks
bench:
go test ./... -bench=.
# https://godoc.org/golang.org/x/tools/cmd/vet
vet:
go vet ./...
godep:
godep save ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment