aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/goccy/go-json/Makefile
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-06-24 14:30:25 +0200
committerTaras Madan <tarasmadan@google.com>2024-07-05 07:51:41 +0000
commit5145b76b8a41b71a7b3c06373959c12f3a22014b (patch)
treed87c1ca1d0979767cc07ace6c0a616ec311a8fc6 /vendor/github.com/goccy/go-json/Makefile
parent7d7fe8807550c6e02def380d335ae0230f1e495c (diff)
vendor: add bigquery client library
Diffstat (limited to 'vendor/github.com/goccy/go-json/Makefile')
-rw-r--r--vendor/github.com/goccy/go-json/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/github.com/goccy/go-json/Makefile b/vendor/github.com/goccy/go-json/Makefile
new file mode 100644
index 000000000..5bbfc4c9a
--- /dev/null
+++ b/vendor/github.com/goccy/go-json/Makefile
@@ -0,0 +1,39 @@
+PKG := github.com/goccy/go-json
+
+BIN_DIR := $(CURDIR)/bin
+PKGS := $(shell go list ./... | grep -v internal/cmd|grep -v test)
+COVER_PKGS := $(foreach pkg,$(PKGS),$(subst $(PKG),.,$(pkg)))
+
+COMMA := ,
+EMPTY :=
+SPACE := $(EMPTY) $(EMPTY)
+COVERPKG_OPT := $(subst $(SPACE),$(COMMA),$(COVER_PKGS))
+
+$(BIN_DIR):
+ @mkdir -p $(BIN_DIR)
+
+.PHONY: cover
+cover:
+ go test -coverpkg=$(COVERPKG_OPT) -coverprofile=cover.out ./...
+
+.PHONY: cover-html
+cover-html: cover
+ go tool cover -html=cover.out
+
+.PHONY: lint
+lint: golangci-lint
+ $(BIN_DIR)/golangci-lint run
+
+golangci-lint: | $(BIN_DIR)
+ @{ \
+ set -e; \
+ GOLANGCI_LINT_TMP_DIR=$$(mktemp -d); \
+ cd $$GOLANGCI_LINT_TMP_DIR; \
+ go mod init tmp; \
+ GOBIN=$(BIN_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0; \
+ rm -rf $$GOLANGCI_LINT_TMP_DIR; \
+ }
+
+.PHONY: generate
+generate:
+ go generate ./internal/...