Skip to content

Commit abb5087

Browse files
committed
Add lint option to Makefile and fix lint issues
1 parent bc0e7c8 commit abb5087

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ Note: if you’d like to implement a new feature, please consider creating a fea
6060
* Run `gofmt` over your code to automatically resolve a lot of style issues. Most editors support this running automatically when saving a code file.
6161
* Run `go lint` and `go vet` on your code too to catch any other issues.
6262
* Follow this guide on some good practice and idioms for Go - https://github.com/golang/go/wiki/CodeReviewComments
63+
* To check for extra issues, install [golangci-lint](https://github.com/golangci/golangci-lint) and run `make lint` or `golangci-lint run`

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ NGINX_IMAGE=nginxplus:$(NGINX_PLUS_VERSION)
33

44
test: docker-build run-nginx-plus test-run configure-no-stream-block test-run-no-stream-block clean
55

6+
lint:
7+
golangci-lint run
8+
69
docker-build:
710
docker build --build-arg NGINX_PLUS_VERSION=$(NGINX_PLUS_VERSION)~stretch -t $(NGINX_IMAGE) docker
811

tests/client_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,6 @@ func TestStats(t *testing.T) {
462462
if ups.Peers[0].State != "up" {
463463
t.Errorf("upstream server state should be 'up'")
464464
}
465-
if ups.Peers[0].Responses.Total < 0 {
466-
t.Errorf("upstream should have total responses value")
467-
}
468465
if ups.Peers[0].HealthChecks.LastPassed {
469466
t.Errorf("upstream server health check should report last failed")
470467
}

0 commit comments

Comments
 (0)