Skip to content

Commit

Permalink
refactor: strict linters
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jul 10, 2020
1 parent 21fbe0a commit 1dc5350
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
23 changes: 4 additions & 19 deletions .golangci.yml
@@ -1,21 +1,6 @@
---
linters:
enable:
- deadcode
- errcheck
- goconst
- gofmt
- goimports
- golint
- gosimple
- govet
- interfacer
- maligned
- misspell
- nakedret
- staticcheck
- structcheck
- unconvert
- unused
- varcheck
disable-all: true
enable-all: true
disable:
- wsl
- goerr113
12 changes: 8 additions & 4 deletions dataeq/dataeq_test.go
@@ -1,10 +1,11 @@
package dataeq
package dataeq_test

import (
"fmt"
"testing"

"github.com/stretchr/testify/require"
"github.com/suzuki-shunsuke/go-dataeq/dataeq"
)

func TestJSON_ConvertByte(t *testing.T) {
Expand Down Expand Up @@ -48,8 +49,9 @@ func TestJSON_ConvertByte(t *testing.T) {
},
}
for _, d := range data {
d := d
t.Run(d.title, func(t *testing.T) {
a, err := JSON.ConvertByte(d.b)
a, err := dataeq.JSON.ConvertByte(d.b)
if d.isError {
require.NotNil(t, err)
return
Expand Down Expand Up @@ -104,8 +106,9 @@ func TestJSON_Convert(t *testing.T) {
},
}
for _, d := range data {
d := d
t.Run(d.title, func(t *testing.T) {
a, err := JSON.Convert(d.x)
a, err := dataeq.JSON.Convert(d.x)
if d.isError {
require.NotNil(t, err)
return
Expand Down Expand Up @@ -162,8 +165,9 @@ func TestJSON_Equal(t *testing.T) {
},
}
for _, d := range data {
d := d
t.Run(d.title, func(t *testing.T) {
f, err := JSON.Equal(d.x, d.y)
f, err := dataeq.JSON.Equal(d.x, d.y)
if d.isError {
require.NotNil(t, err)
return
Expand Down
2 changes: 1 addition & 1 deletion dataeq/json.go
Expand Up @@ -4,4 +4,4 @@ import (
"encoding/json"
)

var JSON = New(json.Marshal, json.Unmarshal)
var JSON = New(json.Marshal, json.Unmarshal) //nolint:gochecknoglobals

0 comments on commit 1dc5350

Please sign in to comment.