aboutsummaryrefslogtreecommitdiffstats
path: root/defererr.go
diff options
context:
space:
mode:
authorTeddy Wing2023-05-21 21:39:48 +0200
committerTeddy Wing2023-05-21 21:39:48 +0200
commit8efe2cc2f9495b60b5a27f818af7d666651aee4d (patch)
tree83fb472f7c31ddff74dc8920b3ced1b6120380f3 /defererr.go
parentaf42c108f8f29fd6290940cc9fd6c5819d25ad74 (diff)
downloadgodefererr-8efe2cc2f9495b60b5a27f818af7d666651aee4d.tar.bz2
Report function signature declaration using variable name other than err
I had previously hard-coded the variable name "err" as the recommended name declaration in the function signature for simplicity. Now, use the name assigned in the `defer` instead, which is more correct.
Diffstat (limited to 'defererr.go')
-rw-r--r--defererr.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/defererr.go b/defererr.go
index 96072be..f6167ae 100644
--- a/defererr.go
+++ b/defererr.go
@@ -334,8 +334,8 @@ func checkErrorAssignedInDefer(
if !isErrorNameInReturnSignature {
pass.Reportf(
errorReturnField.Pos(),
- "return signature should be '(err error)'", // TODO: Use name from ident.Name
- // errorReturnField,
+ "return signature should be '(%s error)'", // TODO: Use name from ident.Name
+ ident,
)
break