From ff4d6e3c7bd7484b2f209d78fd324638e878629f Mon Sep 17 00:00:00 2001 From: Tuna Date: Tue, 10 Apr 2018 11:06:59 +0700 Subject: [PATCH] add gofmt to Makefile --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8a758feeb1..4302b8ec40 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,12 @@ .PHONY: tomo-windows tomo-windows-386 tomo-windows-amd64 GOBIN = $(shell pwd)/build/bin +GOFMT = gofmt GO ?= latest +GO_PACKAGES = . +GO_FILES := $(shell find $(shell go list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go) + +GIT = git tomo: build/env.sh go run build/ci.go install ./cmd/tomo @@ -143,4 +148,8 @@ tomo-windows-386: tomo-windows-amd64: build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/tomo @echo "Windows amd64 cross compilation done:" - @ls -ld $(GOBIN)/tomo-windows-* | grep amd64 + @ls -ld $(GOBIN)/geth-windows-* | grep amd64 + +gofmt: + $(GOFMT) -s -w $(GO_FILES) + $(GIT) checkout vendor