aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1ee128f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+TARGET = go-example
+RUN_MODE ?= development
+GO ?= go
+
+$(TARGET): */*.go go.sum
+ $(GO) build -o $@ ./cmd/main/
+
+.PHONY: test
+test:
+ $(GO) test -cover -coverprofile=coverage.out -v ./...
+ $(GO) tool cover -html=coverage.out -o cover.html
+ rm coverage.out
+
+.PHONY: lint
+lint: fmt
+ ~/go/bin/golangci-lint run -v
+
+.PHONY: clean
+clean:
+ rm $(TARGET)
+
+.PHONY: fmt
+fmt:
+ ~/go/bin/goimports -local www.thenautilus.net/cgit -w .
+ ~/go/bin/gci write -s Standard -s Default -s 'Prefix(www.thenautilus.net/cgit)' .
+ ~/go/bin/gofumpt -l -w .
+
+.PHONY: run
+run: $(TARGET)
+ ./$(TARGET) --verbose --log-format=console $(ARGS)
+
+.PHONY: update
+update:
+ go get -u -t ./...