diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a728e15..0815db2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - go-version: [ 1.19, "1.20" ] + go-version: [ "1.20", "1.21" ] runs-on: ubuntu-latest env: GOLANGCI_LINT_VERSION: v1.51.0 diff --git a/Makefile b/Makefile index 07fda0e..dd2cd7e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,26 @@ -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 # Run benchmarks bench: