Skip to content

Commit 050a39d

Browse files
authored
Fix linters up to golangci-lint v1.53.3 (#34)
1 parent df9bfa6 commit 050a39d

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.golangci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ linters-settings:
3838
- standard
3939
- default
4040
- prefix(github.com/sagmor/fun)
41+
depguard:
42+
rules:
43+
root:
44+
files:
45+
- "*.go"
46+
allow:
47+
- $gostd
48+
- github.com/sagmor/fun
49+
- github.com/sagmor/fun/maybe
50+
- github.com/sagmor/fun/promise
51+
- github.com/sagmor/fun/result
52+
- github.com/sagmor/fun/task
53+
tests:
54+
files:
55+
- tests/**/*.go
56+
deny:
57+
- pkg: none
58+
4159
revive:
4260
enable-all-rules: true
4361
rules:

result/stepping.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var ErrTypeConversionFailed = errors.New("failed to convert between types")
8888
func AsFun[T, S any](source S) (T, error) {
8989
var result T
9090

91-
result, ok := interface{}(source).(T)
91+
result, ok := any(source).(T)
9292
if !ok {
9393
return result, fmt.Errorf("[%w] from %v to %T", ErrTypeConversionFailed, source, result)
9494
}

tests/nothing_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ func TestNil(t *testing.T) {
1313

1414
assert.Equal(t, 0, fun.Nil[int]())
1515
assert.Equal(t, "", fun.Nil[string]())
16-
assert.Equal(t, nil, fun.Nil[interface{}]())
16+
assert.Equal(t, nil, fun.Nil[any]())
1717
assert.Equal(t, struct{}{}, fun.Nil[struct{}]())
1818
}

0 commit comments

Comments
 (0)