diff --git a/Makefile b/Makefile index d1255f8..1c29a28 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help init setup build run test test-race lint lint-fix security clean +.PHONY: help init setup build run test test-race lint lint-fix security docs clean include tools.versions @@ -30,6 +30,7 @@ tools: ## Install tool binaries to GOPATH/bin (versions from tools.versions) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) go install github.com/securego/gosec/v2/cmd/gosec@$(GOSEC_VERSION) go install golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION) + go install golang.org/x/pkgsite/cmd/pkgsite@$(PKGSITE_VERSION) # ── Build ────────────────────────────────────────────────────────────────────── build: ## Compile the binary to ./bin/ @@ -64,6 +65,10 @@ security: ## Run gosec + govulncheck @echo "--- govulncheck ---" go run golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION) ./... +# ── Docs ─────────────────────────────────────────────────────────────────────── +docs: ## Serve package documentation locally via pkgsite (http://localhost:8080) + go run golang.org/x/pkgsite/cmd/pkgsite@$(PKGSITE_VERSION) -open . + # ── Release ──────────────────────────────────────────────────────────────────── release: ## List releases, or tag+push a new one (usage: make release VERSION=v0.1.0) ifdef VERSION diff --git a/tools.versions b/tools.versions index 1cedb89..a40342f 100644 --- a/tools.versions +++ b/tools.versions @@ -2,3 +2,4 @@ DELVE_VERSION=v1.26.1 GOLANGCI_LINT_VERSION=v1.64.8 GOSEC_VERSION=v2.24.7 GOVULNCHECK_VERSION=v1.1.4 +PKGSITE_VERSION=latest