-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
I noticed a bunch of new warnings from nakedret today that coincide with #10 being merged. While that PR does report some real cases that were previously ignored, it seems to also flag returns in nested functions.
Take the following example module:
package x
func Dummy() (err error) {
defer func() {
// perform cleanup
return
}()
return nil
}
I get the following output from the tool:
$ $GOPATH/bin/nakedret -l 5 x.go
x.go:6 Dummy naked returns on 6 line function
While there is a naked return
statement in Dummy
's AST, it belongs to a nested function with no return values, so should not be reported.
programmer04
Metadata
Metadata
Assignees
Labels
No labels