Browse Source

Merge 6873cd4a8f into 91708ff8e3

pull/661/merge
sukhjit 4 years ago committed by GitHub
parent
commit
802d5c4fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 11
      .golangci.yaml
  3. 13
      Makefile
  4. 2
      mux_httpserver_test.go
  5. 1
      route.go

1
.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
/bin

11
.golangci.yaml

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
run:
timeout: 5m
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- ineffassign
- staticcheck
- unused

13
Makefile

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
GOBIN=$(shell pwd)/bin
install-lint:
@if [ ! -f "$(GOBIN)/golangci-lint" ]; then \
curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.42.0; \
fi
lint: install-lint
@echo "golangci-lint run ./..."
@$(GOBIN)/golangci-lint run ./...
test:
go test -race -failfast ./...

2
mux_httpserver_test.go

@ -25,6 +25,8 @@ func TestSchemeMatchers(t *testing.T) { @@ -25,6 +25,8 @@ func TestSchemeMatchers(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error getting from server: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
t.Fatalf("expected a status code of 200, got %v", resp.StatusCode)
}

1
route.go

@ -64,6 +64,7 @@ func (r *Route) Match(req *http.Request, match *RouteMatch) bool { @@ -64,6 +64,7 @@ func (r *Route) Match(req *http.Request, match *RouteMatch) bool {
match.MatchErr = nil
}
// nolint: ineffassign
matchErr = nil
return false
}

Loading…
Cancel
Save