File tree 2 files changed +6
-6
lines changed
go/analysis/passes/errorsas 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
51
51
return // not enough arguments, e.g. called with return values of another function
52
52
}
53
53
if fn .FullName () == "errors.As" && ! pointerToInterfaceOrError (pass , call .Args [1 ]) {
54
- pass .ReportRangef (call , "second argument to errors.As must be a pointer to an interface or a type implementing error" )
54
+ pass .ReportRangef (call , "second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type " )
55
55
}
56
56
})
57
57
return nil , nil
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ func _() {
34
34
errors .As (nil , perr ()) // *error, via a call
35
35
errors .As (nil , ei ) // empty interface
36
36
37
- errors .As (nil , nil ) // want `second argument to errors.As must be a pointer to an interface or a type implementing error`
38
- errors .As (nil , e ) // want `second argument to errors.As must be a pointer to an interface or a type implementing error`
39
- errors .As (nil , m ) // want `second argument to errors.As must be a pointer to an interface or a type implementing error`
40
- errors .As (nil , f ) // want `second argument to errors.As must be a pointer to an interface or a type implementing error`
41
- errors .As (nil , & i ) // want `second argument to errors.As must be a pointer to an interface or a type implementing error`
37
+ errors .As (nil , nil ) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type `
38
+ errors .As (nil , e ) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type `
39
+ errors .As (nil , m ) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type `
40
+ errors .As (nil , f ) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type `
41
+ errors .As (nil , & i ) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type `
42
42
errors .As (two ())
43
43
}
You can’t perform that action at this time.
0 commit comments