From d289643458c0e25587b3b70f0050a01421ccc584 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Thu, 24 Jun 2021 21:28:28 +0100 Subject: [PATCH] build-sys: replace gofmt.sh with `make fmt` Signed-off-by: Alejandro Mery --- Makefile | 15 +++++++++++++++ gofmt.sh | 4 ---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 Makefile delete mode 100755 gofmt.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..befaa26 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: all fmt build test + +GO ?= go + +all: fmt build + +fmt: + $(GO) fmt ./... + $(GO) mod tidy || true + +build: + $(GO) get -v ./... + +test: + $(GO) test -v ./... diff --git a/gofmt.sh b/gofmt.sh deleted file mode 100755 index 481e702..0000000 --- a/gofmt.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -BASE="$(dirname "$0")" -exec gofmt -l -w -e -s -- $(find "$BASE" -type f -name '*.go')