Skip to content

Commit 02a8d32

Browse files
committed
Move checks to Makefile
Signed-off-by: Aylei <[email protected]>
1 parent bb6a42d commit 02a8d32

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

.travis.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@ env:
1010
install:
1111
- go mod download
1212

13-
before_script:
14-
- GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
15-
- go get honnef.co/go/tools/cmd/staticcheck
16-
1713
script:
18-
- echo $GO_FILES | xargs gofmt -l # Fail if a .go file hasn't been formatted with gofmt
19-
- go test -v -race ./... # Run all the tests with the race detector enabled
20-
- go vet ./... # go vet is the official Go static analyzer
21-
- staticcheck ./... # "go vet on steroids" + linter
14+
- make check
2215

2316
before_deploy:
2417
- make agent-docker

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.PHONY: build plugin agent
1+
.PHONY: build plugin agent check
22

33
GOENV := GO15VENDOREXPERIMENT="1" GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64
4-
GO := $(GOENV) go build
4+
GO := $(GOENV) go
55

66
default: build
77

@@ -14,4 +14,9 @@ agent-docker: agent
1414
docker build . -t aylei/debug-agent:latest
1515

1616
agent:
17-
$(GO) -o debug-agent cmd/agent/main.go
17+
$(GO) build -o debug-agent cmd/agent/main.go
18+
19+
check:
20+
find . -iname '*.go' -type f | grep -v /vendor/ | xargs gofmt -l
21+
GO111MODULE=on go test -v -race ./...
22+
$(GO) vet ./...

pkg/plugin/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (o *DebugOptions) Complete(cmd *cobra.Command, args []string, argsLenAtDash
231231
o.DebugAgentDaemonSet = defaultDaemonSetName
232232
}
233233
}
234-
if config.PortForward == true {
234+
if config.PortForward {
235235
o.PortForward = true
236236
}
237237
o.Ports = []string{strconv.Itoa(o.AgentPort)}

0 commit comments

Comments
 (0)