dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/Makefile (about)

     1  .PHONY: test unittest lint
     2  
     3  ARCH=$(shell uname -m)
     4  GO=CGO_ENABLED=0 GO111MODULE=on go
     5  
     6  tidy:
     7  	go mod tidy
     8  
     9  unittest:
    10  	$(GO) test ./... -coverprofile=coverage.out ./...
    11  
    12  lint:
    13  	@which golangci-lint >/dev/null || echo "WARNING: go linter not installed. To install, run make install-lint"
    14  	@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
    15  
    16  install-lint:
    17  	sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.54.2
    18  
    19  test: unittest lint
    20  	$(GO) vet ./...
    21  	gofmt -l $$(find . -type f -name '*.go'| grep -v "/vendor/")
    22  	[ "`gofmt -l $$(find . -type f -name '*.go'| grep -v "/vendor/")`" = "" ]
    23  
    24  vendor:
    25  	go mod vendor