aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2024-03-16 16:10:21 +0700
committerShulhan <m.shulhan@gmail.com>2026-03-27 02:56:30 +0700
commit045799b6f22dffa15d613442ca89999d240579b7 (patch)
treea35df92bda588fc3324c0d6d51290023dbfb7924
parentd25ba3de70123bbe0659bfab221fc850b892dd17 (diff)
downloadgo-x-crypto-045799b6f22dffa15d613442ca89999d240579b7.tar.xz
all: add makefile for common tasks
Change-Id: Ie26c0a39f9160a0a2c246d0c95ac16d159c9e750
-rw-r--r--.gitignore2
-rw-r--r--Makefile18
2 files changed, 20 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 5a9d62e..a7b710b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
# Add no patterns to .gitignore except for files generated by the build.
last-change
+cover.html
+cover.out
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5cb209c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+COVER_OUT:=cover.out
+COVER_HTML:=cover.html
+
+.PHONY: test
+test:
+ CGO_ENABLED=1 go test -failfast -timeout=5m -race -coverprofile=$(COVER_OUT) ./...
+ go tool cover -html=$(COVER_OUT) -o $(COVER_HTML)
+
+.PHONY: lint
+lint:
+ -fieldalignment ./...
+ -shadow ./...
+ -golangci-lint run \
+ --presets bugs,metalinter,performance,unused \
+ --disable exhaustive \
+ --disable musttag \
+ --disable bodyclose \
+ ./...