rclone/vendor/go.uber.org/multierr/Makefile

43 lines
945 B
Makefile
Raw Normal View History

2020-06-27 16:45:12 +02:00
# Directory to put `go install`ed binaries in.
export GOBIN ?= $(shell pwd)/bin
2020-05-11 20:57:46 +02:00
GO_FILES := $(shell \
find . '(' -path '*/.*' -o -path './vendor' ')' -prune \
-o -name '*.go' -print | cut -b3-)
.PHONY: build
build:
2020-06-27 16:45:12 +02:00
go build ./...
2020-05-11 20:57:46 +02:00
.PHONY: test
test:
2020-06-27 16:45:12 +02:00
go test -race ./...
2020-05-11 20:57:46 +02:00
.PHONY: gofmt
gofmt:
$(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX))
@gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true
@[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" | cat - $(FMT_LOG) && false)
.PHONY: golint
golint:
2020-06-27 16:45:12 +02:00
@go install golang.org/x/lint/golint
@$(GOBIN)/golint ./...
2020-05-11 20:57:46 +02:00
.PHONY: staticcheck
staticcheck:
2020-06-27 16:45:12 +02:00
@go install honnef.co/go/tools/cmd/staticcheck
@$(GOBIN)/staticcheck ./...
2020-05-11 20:57:46 +02:00
.PHONY: lint
2020-06-27 16:45:12 +02:00
lint: gofmt golint staticcheck
2020-05-11 20:57:46 +02:00
.PHONY: cover
cover:
2020-06-27 16:45:12 +02:00
go test -coverprofile=cover.out -coverpkg=./... -v ./...
2020-05-11 20:57:46 +02:00
go tool cover -html=cover.out -o cover.html
update-license:
2020-06-27 16:45:12 +02:00
@go install go.uber.org/tools/update-license
@$(GOBIN)/update-license $(GO_FILES)