From bb488489312a5d3e6fa6a90cffeb398a3af625e0 Mon Sep 17 00:00:00 2001 From: andy xie Date: Wed, 21 Dec 2016 17:55:14 +0800 Subject: [PATCH] add fmt and vet make target --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2ddaeac9..bd625154 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all container push clean node-problem-detector +.PHONY: all container push clean node-problem-detector vet fmt all: push @@ -9,7 +9,13 @@ PROJ = google_containers PKG_SOURCES := $(shell find pkg -name '*.go') -node-problem-detector: $(PKG_SOURCES) node_problem_detector.go +vet: + go list ./... | grep -v "./vendor/*" | xargs go vet + +fmt: + find . -type f -name "*.go" | grep -v "./vendor/*" | xargs gofmt -s -w -l + +node-problem-detector: $(PKG_SOURCES) node_problem_detector.go fmt vet GOOS=linux go build -ldflags '-w -extldflags "-static"' -o node-problem-detector test: