File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 1+ GO ?= go
2+ GOFMT ?= gofmt "-s"
3+ GOFILES := $(shell find . -name "* .go" -type f -not -path "./vendor/* ")
4+ VETPACKAGES ?= $(shell $(GO ) list ./... | grep -v /vendor/ | grep -v /examples/)
5+
6+ .PHONY : build
7+ build : fmt-check
8+ $(GO ) build -o app main.go
9+
10+ .PHONY : test
11+ test :
12+ $(GO ) test -v -coverprofile=cover.out ./...
13+
14+ .PHONY : cover
15+ cover :
16+ $(GO ) tool cover -func=cover.out -o cover_total.out
17+ $(GO ) tool cover -html=cover.out -o cover.html
18+
19+ .PHONY : fmt
20+ fmt :
21+ $(GOFMT ) -w $(GOFILES )
22+
23+ .PHONY : fmt-check
24+ fmt-check :
25+ @diff=$$($(GOFMT ) -d $(GOFILES ) ) ; \
26+ if [ -n " $$ diff" ]; then \
27+ echo " Please run 'make fmt' and commit the result:" ; \
28+ echo " $$ {diff}" ; \
29+ exit 1; \
30+ fi ; \
31+ echo " \033[34m[Code] format perfect!\033[0m" ;
32+
33+ vet :
34+ $(GO ) vet $(VETPACKAGES )
35+
36+ .PHONY : lint
37+ lint :
38+ golangci-lint run
Original file line number Diff line number Diff line change 11# Gomail
2-
2+ [ ![ build ] ( https://github.com/verystar/gomail/actions/workflows/build.yml/badge.svg )] ( https://github.com/verystar/gomail/actions/workflows/build.yml )
33
44Fork https://github.com/go-gomail/gomail
55
You can’t perform that action at this time.
0 commit comments