2021-05-07 18:06:08 +08:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
.PHONY: all check format vet build test generate tidy
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>\` where <target> is one of"
|
|
|
|
@echo " check to do static check"
|
|
|
|
@echo " build to create bin directory and build"
|
|
|
|
@echo " test to run test"
|
|
|
|
|
|
|
|
format:
|
2021-07-15 17:59:57 +08:00
|
|
|
go fmt ./...
|
2021-05-07 18:06:08 +08:00
|
|
|
|
|
|
|
vet:
|
2021-07-15 17:59:57 +08:00
|
|
|
go vet ./...
|
|
|
|
|
|
|
|
generate:
|
|
|
|
go generate ./...
|
2021-05-07 18:06:08 +08:00
|
|
|
|
2021-07-15 17:59:57 +08:00
|
|
|
build: tidy generate format vet
|
|
|
|
go build -o bin/beyondfs ./cmd/beyondfs
|
2021-05-07 18:06:08 +08:00
|
|
|
|
|
|
|
test:
|
2021-07-15 17:59:57 +08:00
|
|
|
go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
|
|
|
|
go tool cover -html="coverage.txt" -o "coverage.html"
|
2021-05-07 18:06:08 +08:00
|
|
|
|
|
|
|
tidy:
|
2021-07-15 17:59:57 +08:00
|
|
|
go mod tidy
|
|
|
|
go mod verify
|
|
|
|
|
|
|
|
clean:
|
|
|
|
find . -type f -name '*gen*.go' -delete
|