Skip to content

Commit

Permalink
Merge pull request #4 from fastbill/change-linter
Browse files Browse the repository at this point in the history
change linter
  • Loading branch information
junedev authored Aug 21, 2019
2 parents c5d9a24 + 1c83555 commit defd5f5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
linters:
enable:
- gocyclo
- golint
- dupl
- interfacer
- unconvert
- goconst
- gosec
- bodyclose

run:
deadline: 10m

issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- goconst
- gosec
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ language: go
go:
- 1.11.x

before_install:
install:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
- go get -u gopkg.in/alecthomas/gometalinter.v2
- gometalinter.v2 --install
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.17.1

script:
- go test -race -cover ./...
- gometalinter.v2 --vendor --deadline=300s ./...
- ./bin/golangci-lint run

notifications:
email: false
3 changes: 2 additions & 1 deletion httperrors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func TestWriteJSON(t *testing.T) {
t.Run(testCase.name, func(t *testing.T) {
he := New(testCase.code, testCase.message)
w := httptest.NewRecorder()
he.WriteJSON(w)
err := he.WriteJSON(w)
assert.NoError(t, err)

assert.Equal(t, testCase.code, w.Code)
assert.Equal(t, testCase.result+"\n", w.Body.String())
Expand Down

0 comments on commit defd5f5

Please sign in to comment.