72 lines
810 B
Go
72 lines
810 B
Go
//golangcitest:args -Enakedret
|
|
package testdata
|
|
|
|
import "fmt"
|
|
|
|
func NakedretIssue() (a int, b string) {
|
|
if a > 0 {
|
|
return // want "naked return in func `NakedretIssue` with 33 lines of code"
|
|
}
|
|
|
|
fmt.Println("nakedret")
|
|
|
|
if b == "" {
|
|
return 0, "0"
|
|
}
|
|
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
|
|
// len of this function is 33
|
|
return // want "naked return in func `NakedretIssue` with 33 lines of code"
|
|
}
|
|
|
|
func NoNakedretIssue() (a int, b string) {
|
|
if a > 0 {
|
|
return
|
|
}
|
|
|
|
if b == "" {
|
|
return 0, "0"
|
|
}
|
|
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
// ...
|
|
|
|
// len of this function is 30
|
|
return
|
|
}
|