2018-06-30 15:41:47 +03:00

68 lines
690 B
Go

//args: -Enakedret
package testdata
func NakedretIssue() (a int, b string) {
if a > 0 {
return
}
if b == "" {
return 0, "0"
}
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// ...
// len of this function is 31
return // ERROR "naked return in func `NakedretIssue` with 31 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
}