Skip to content

Commit

Permalink
lint: minor optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Sep 5, 2022
1 parent af6e598 commit f168fd9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: set up go 1.16
- name: set up go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: checkout
Expand All @@ -32,7 +32,7 @@ jobs:

- name: install golangci-lint and goveralls
run: |
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.39.0
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.49.0
GO111MODULE=off go get -u -v github.com/mattn/goveralls
- name: run linters
Expand Down
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ linters:
- govet
- unconvert
- megacheck
- structcheck
- gas
- gocyclo
- dupl
- misspell
- unparam
- varcheck
- deadcode
- unused
- typecheck
- ineffassign
- varcheck
- stylecheck
- gochecknoinits
- exportloopref
Expand Down
2 changes: 1 addition & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func Health(path string, checkers ...func(ctx context.Context) (name string, err

return func(h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" || strings.ToLower(r.URL.Path) != path {
if r.Method != "GET" || !strings.EqualFold(r.URL.Path, path) {
h.ServeHTTP(w, r) // not the health check request, continue the chain
return
}
Expand Down

0 comments on commit f168fd9

Please sign in to comment.