Skip to content

Commit 92b9263

Browse files
committed
Fix lint issues
reported by: - golint - golangci-lint
1 parent 60c66ab commit 92b9263

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

common.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"reflect"
66
)
77

8-
98
func validateOut(output reflect.Value) error {
109
zeroValue := reflect.Value{}
1110
if output == zeroValue {

filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// Validations:
1515
//
1616
// 1. Input and Output's slice should be of same type
17-
// 2. Predicate function can take one argment and return one argument
17+
// 2. Predicate function can take one argument and return one argument
1818
// 3. Predicate's return argument is always boolean.
1919
// 4. Predicate's input argument should be input/output slice's element type.
2020
//

filter_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,22 @@ func TestFilter(t *testing.T) {
2323

2424
t.Run("should struct types", func(t *testing.T) {
2525
type person struct {
26-
name string
27-
age int
26+
age int
2827
}
2928
input := []person{
30-
{"john", 30},
31-
{"doe", 20},
32-
{"foo", 40},
33-
{"bar", 10},
29+
{30},
30+
{20},
31+
{40},
32+
{10},
3433
}
3534
var output []person
3635

3736
err := godash.Filter(input, &output, func(p person) bool {
3837
return p.age > 20
3938
})
4039
expected := []person{
41-
{"john", 30},
42-
{"foo", 40},
40+
{30},
41+
{40},
4342
}
4443

4544
assert.NoError(t, err)

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
22
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
33
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
44
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5+
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
56
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
67
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
78
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=

map_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ func TestMap(t *testing.T) {
2424
t.Run("support structs", func(t *testing.T) {
2525
type person struct {
2626
name string
27-
age int
2827
}
2928

3029
in := []person{
31-
{name: "john", age: 20},
32-
{name: "doe", age: 23},
30+
{name: "john"},
31+
{name: "doe"},
3332
}
3433
out := make([]string, 0)
3534
expected := []string{"john", "doe"}

reduce_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ func TestReduce(t *testing.T) {
5656

5757
t.Run("support structs", func(t *testing.T) {
5858
type person struct {
59-
name string
60-
age int
59+
age int
6160
}
6261

6362
in := []person{
64-
{name: "john", age: 20},
65-
{name: "doe", age: 23},
63+
{age: 20},
64+
{age: 23},
6665
}
6766
out := 0
6867
expected := 43

0 commit comments

Comments
 (0)