summaryrefslogtreecommitdiffstats
path: root/vendor/go.uber.org/zap/Makefile
diff options
context:
space:
mode:
authorDuco van Amstel <helcaraxan@gmail.com>2018-11-18 17:55:05 +0000
committerWim <wim@42.be>2018-11-25 21:21:04 +0100
commit09875fe1603307080f3a4172985c5dca3bd9912d (patch)
treea23220772f6f6597d509ca71b2df3480a77b8076 /vendor/go.uber.org/zap/Makefile
parentf716b8fc0ff90f47b61e218ef34019b38bd70e0d (diff)
downloadmatterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.gz
matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.bz2
matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.zip
Update direct dependencies where possible
Diffstat (limited to 'vendor/go.uber.org/zap/Makefile')
-rw-r--r--vendor/go.uber.org/zap/Makefile76
1 files changed, 76 insertions, 0 deletions
diff --git a/vendor/go.uber.org/zap/Makefile b/vendor/go.uber.org/zap/Makefile
new file mode 100644
index 00000000..ef7893b3
--- /dev/null
+++ b/vendor/go.uber.org/zap/Makefile
@@ -0,0 +1,76 @@
+export GO15VENDOREXPERIMENT=1
+
+BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem
+PKGS ?= $(shell glide novendor)
+# Many Go tools take file globs or directories as arguments instead of packages.
+PKG_FILES ?= *.go zapcore benchmarks buffer zapgrpc zaptest zaptest/observer internal/bufferpool internal/exit internal/color internal/ztest
+
+# The linting tools evolve with each Go version, so run them only on the latest
+# stable release.
+GO_VERSION := $(shell go version | cut -d " " -f 3)
+GO_MINOR_VERSION := $(word 2,$(subst ., ,$(GO_VERSION)))
+LINTABLE_MINOR_VERSIONS := 10
+ifneq ($(filter $(LINTABLE_MINOR_VERSIONS),$(GO_MINOR_VERSION)),)
+SHOULD_LINT := true
+endif
+
+
+.PHONY: all
+all: lint test
+
+.PHONY: dependencies
+dependencies:
+ @echo "Installing Glide and locked dependencies..."
+ glide --version || go get -u -f github.com/Masterminds/glide
+ glide install
+ @echo "Installing test dependencies..."
+ go install ./vendor/github.com/axw/gocov/gocov
+ go install ./vendor/github.com/mattn/goveralls
+ifdef SHOULD_LINT
+ @echo "Installing golint..."
+ go install ./vendor/github.com/golang/lint/golint
+else
+ @echo "Not installing golint, since we don't expect to lint on" $(GO_VERSION)
+endif
+
+# Disable printf-like invocation checking due to testify.assert.Error()
+VET_RULES := -printf=false
+
+.PHONY: lint
+lint:
+ifdef SHOULD_LINT
+ @rm -rf lint.log
+ @echo "Checking formatting..."
+ @gofmt -d -s $(PKG_FILES) 2>&1 | tee lint.log
+ @echo "Installing test dependencies for vet..."
+ @go test -i $(PKGS)
+ @echo "Checking vet..."
+ @$(foreach dir,$(PKG_FILES),go tool vet $(VET_RULES) $(dir) 2>&1 | tee -a lint.log;)
+ @echo "Checking lint..."
+ @$(foreach dir,$(PKGS),golint $(dir) 2>&1 | tee -a lint.log;)
+ @echo "Checking for unresolved FIXMEs..."
+ @git grep -i fixme | grep -v -e vendor -e Makefile | tee -a lint.log
+ @echo "Checking for license headers..."
+ @./check_license.sh | tee -a lint.log
+ @[ ! -s lint.log ]
+else
+ @echo "Skipping linters on" $(GO_VERSION)
+endif
+
+.PHONY: test
+test:
+ go test -race $(PKGS)
+
+.PHONY: cover
+cover:
+ ./scripts/cover.sh $(PKGS)
+
+.PHONY: bench
+BENCH ?= .
+bench:
+ @$(foreach pkg,$(PKGS),go test -bench=$(BENCH) -run="^$$" $(BENCH_FLAGS) $(pkg);)
+
+.PHONY: updatereadme
+updatereadme:
+ rm -f README.md
+ cat .readme.tmpl | go run internal/readme/readme.go > README.md