github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/simple/s1023/testdata/CheckRedundantReturn/LintRedundantReturn.go (about) 1 package pkg 2 3 func fn1() { 4 return //@ diag(`redundant return`) 5 } 6 7 func fn2(a int) { 8 return //@ diag(`redundant return`) 9 } 10 11 func fn3() int { 12 return 3 13 } 14 15 func fn4() (n int) { 16 return 17 } 18 19 func fn5(b bool) { 20 if b { 21 return 22 } 23 } 24 25 func fn6() { 26 return 27 println("foo") 28 } 29 30 func fn7() { 31 return 32 println("foo") 33 return //@ diag(`redundant return`) 34 } 35 36 func fn8() { 37 _ = func() { 38 return //@ diag(`redundant return`) 39 } 40 }