-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
31 lines (23 loc) · 931 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
# Copyright (c) 2019 Dell Technologies, Inc
#
# SPDX-License-Identifier: Apache-2.0
#
.PHONY: test unittest lint
ARCH=$(shell uname -m)
GO=CGO_ENABLED=1 GO111MODULE=on go
tidy:
go mod tidy
unittest:
$(GO) test -count=1 -race ./... -coverprofile=coverage.out
lint:
@which golangci-lint >/dev/null || echo "WARNING: go linter not installed. To install, run make install-lint"
@if [ "z${ARCH}" = "zx86_64" ] && which golangci-lint >/dev/null ; then golangci-lint run --config .golangci.yml ; else echo "WARNING: Linting skipped (not on x86_64 or linter not installed)"; fi
install-lint:
sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.61.0
test: unittest lint
$(GO) vet ./...
gofmt -l $$(find . -type f -name '*.go'| grep -v "/vendor/")
[ "`gofmt -l $$(find . -type f -name '*.go'| grep -v "/vendor/")`" = "" ]
vendor:
go mod vendor