diff --git a/Makefile b/Makefile index a182b7b..039ca0f 100644 --- a/Makefile +++ b/Makefile @@ -1 +1,23 @@ -include github.com/hamba/make/golang +# Format all files +fmt: + @echo "==> Formatting source" + @gofmt -s -w $(shell find . -type f -name '*.go' -not -path "./vendor/*") + @echo "==> Done" +.PHONY: fmt + +# Tidy the go.mod file +tidy: + @echo "==> Cleaning go.mod" + @go mod tidy + @echo "==> Done" +.PHONY: tidy + +# Run all tests +test: + @go test -cover -race ./... +.PHONY: test + +# Lint the project +lint: + @golangci-lint run ./... +.PHONY: lint