This repository was archived by the owner on Oct 18, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +1024
-0
lines changed Expand file tree Collapse file tree 9 files changed +1024
-0
lines changed Original file line number Diff line number Diff line change 1+ coverage. *
2+ bin /
Original file line number Diff line number Diff line change 1+ SHELL := /bin/bash
2+
3+ .PHONY : all check format vet lint build test generate tidy
4+
5+ help :
6+ @echo " Please use \` make <target>\` where <target> is one of"
7+ @echo " check to do static check"
8+ @echo " build to create bin directory and build"
9+ @echo " generate to generate code"
10+ @echo " test to run test"
11+
12+ # golint: go get -u golang.org/x/lint/golint
13+ # definitions: go get -u github.com/aos-dev/go-storage/cmd/definitions
14+ tools := golint definitions
15+
16+ $(tools ) :
17+ @command -v $@ > /dev/null 2>&1 || echo " $@ is not found, please install it."
18+
19+ check : vet lint
20+
21+ format :
22+ @echo " go fmt"
23+ @go fmt ./...
24+ @echo " ok"
25+
26+ vet :
27+ @echo " go vet"
28+ @go vet ./...
29+ @echo " ok"
30+
31+ lint : golint
32+ @echo " golint"
33+ @golint ./...
34+ @echo " ok"
35+
36+ generate : definitions
37+ @echo " generate code"
38+ @go generate ./...
39+ @go fmt ./...
40+ @echo " ok"
41+
42+ build : generate tidy check
43+ @echo " build storage"
44+ @go build ./...
45+ @echo " ok"
46+
47+ test :
48+ @echo " run test"
49+ @go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
50+ @go tool cover -html=" coverage.txt" -o " coverage.html"
51+ @echo " ok"
52+
53+ tidy :
54+ @go mod tidy && go mod verify
55+
56+ clean :
57+ @echo " clean generated files"
58+ @find . -type f -name ' generated.go' -delete
59+ @echo " Done"
Original file line number Diff line number Diff line change 1+ /*
2+ Package example provided support for local file system.
3+ */
4+ package example
5+
6+ //go:generate definitions service.hcl
You can’t perform that action at this time.
0 commit comments