Skip to content

Instantly share code, notes, and snippets.

@ukdave
Created October 11, 2017 11:53
Show Gist options
  • Save ukdave/4078a559af8acaa110780eed0e1cba37 to your computer and use it in GitHub Desktop.
Save ukdave/4078a559af8acaa110780eed0e1cba37 to your computer and use it in GitHub Desktop.
Makefile for go projects
all: vet test build ok
vet:
$(call announce,"Running vet")
go vet ./...
test:
$(call announce,"Running tests")
go test ./...
build:
$(call announce,"Building")
go build
ok:
@echo
@export TERM=xterm; echo "$$(tput setaf 1)*$$(tput setaf 3)*$$(tput setaf 2)*$$(tput setaf 4)*$$(tput setaf 5)*$$(tput setaf 2) ALL TESTS PASSED $$(tput setaf 5)*$$(tput setaf 4)*$$(tput setaf 2)*$$(tput setaf 3)*$$(tput setaf 1)*$$(tput sgr0)"
define announce
@echo
@export TERM=xterm; echo "$$(tput setaf 4)$$(tput smul)* $(1)$$(tput rmul)$$(tput sgr0)"
endef
.PHONY: vet test build ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment