aboutsummaryrefslogtreecommitdiffstats
path: root/testdata
diff options
context:
space:
mode:
authorTeddy Wing2023-05-25 20:47:05 +0200
committerTeddy Wing2023-05-25 20:47:05 +0200
commit8102c9e6fe7e12d625718e362abb29bf1ecdb13c (patch)
tree4d4017f68e33517d06aa903af28b4f6c2179144b /testdata
parent8bcef611f794272203e05e207259ac8d45d558fb (diff)
downloadgodefererr-8102c9e6fe7e12d625718e362abb29bf1ecdb13c.tar.bz2
shouldDeclareErrInSignature: Add note about variable declaration line
When I was first coming up with ideas for the project, I thought that this line is one I might need to report a diagnostic for, but since the compiler will catch it, we don't need to bother.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/signature.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/testdata/signature.go b/testdata/signature.go
index cc9d72b..d6697c4 100644
--- a/testdata/signature.go
+++ b/testdata/signature.go
@@ -3,7 +3,10 @@ package main
import "errors"
func shouldDeclareErrInSignature() error { // want "return signature should use named error parameter err"
- var err error // Should use variable declared in signature
+ // Should use variable declared in signature. We don't need to report this
+ // as if the variable is declared in the signature, a redeclaration causes
+ // a compile error.
+ var err error
err = nil
if err != nil {