File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 17
17
# If false (default) - golangci-lint acquires file lock on start.
18
18
allow-parallel-runners : true
19
19
20
- skip -dirs :
20
+ exclude -dirs :
21
21
- test/testdata_etc # test files
22
22
- internal/cache # extracted from Go code
23
23
- internal/renameio # extracted from Go code
31
31
# output configuration options
32
32
output :
33
33
# Format: colored-line-number|line-number|json|colored-tab|tab|checkstyle|code-climate|junit-xml|github-actions|teamcity
34
- Format : colored-line-number
34
+ Formats : colored-line-number
35
35
# Multiple can be specified by separating them by comma, output can be provided
36
36
# for each of them by separating format name and path by colon symbol.
37
37
# Output path can be either `stdout`, `stderr` or path to the file to write to.
@@ -153,7 +153,7 @@ linters-settings:
153
153
govet :
154
154
disable :
155
155
- sigchanyzer
156
- check-shadowing : true
156
+ shadow : true
157
157
settings :
158
158
printf :
159
159
funcs :
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ require github.com/stretchr/testify v1.8.4
6
6
7
7
require (
8
8
github.com/davecgh/go-spew v1.1.1 // indirect
9
+ github.com/google/uuid v1.6.0 // indirect
9
10
github.com/pmezard/go-difflib v1.0.0 // indirect
10
11
gopkg.in/yaml.v3 v3.0.1 // indirect
11
12
)
Original file line number Diff line number Diff line change 1
1
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
2
2
github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
3
+ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0 =
4
+ github.com/google/uuid v1.6.0 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
3
5
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
4
6
github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
5
7
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk =
Original file line number Diff line number Diff line change @@ -31,24 +31,13 @@ func (n *Of[T]) GetValue() *T {
31
31
32
32
// SetValue implements the setter.
33
33
func (n * Of [T ]) SetValue (b T ) {
34
- if n == nil {
35
- n = new (Of [T ])
36
- n .SetValue (b )
37
-
38
- return
39
- }
40
-
41
34
n .Val = & b
42
35
}
43
36
44
37
// SetValueP implements the setter by pointer.
45
38
// If ref is not nil, calls SetValue(*ref)
46
39
// If ref is nil, calls SetNull()
47
40
func (n * Of [T ]) SetValueP (ref * T ) {
48
- if n == nil {
49
- n = new (Of [T ])
50
- }
51
-
52
41
if ref != nil {
53
42
n .SetValue (* ref )
54
43
} else {
@@ -59,7 +48,7 @@ func (n *Of[T]) SetValueP(ref *T) {
59
48
// SetNull set to null.
60
49
func (n * Of [T ]) SetNull () {
61
50
if n == nil {
62
- panic ( "calling SetNull on nil receiver" )
51
+ return
63
52
}
64
53
65
54
n .Val = nil
You can’t perform that action at this time.
0 commit comments