1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-10 03:17:11 +02:00
revive/fixtures/bare-return.go
SalvadorC 745bcf65aa bare-return (first working version) (#117)
New rule bare-return
2019-04-17 22:55:52 +02:00

34 lines
638 B
Go

package fixtures
func bare1() (int, int, error) {
go func() (a int) {
return // MATCH /avoid using bare returns, please add return expressions/
}(5)
}
func bare2(a, b int) (int, error, int) {
defer func() (a int) {
return // MATCH /avoid using bare returns, please add return expressions/
}(5)
}
func bare3(a string, b int) (a int, b float32, c string, d string) {
go func() (a int, b int) {
return a, b
}(5, 6)
defer func() (a int) {
return a
}(5)
return // MATCH /avoid using bare returns, please add return expressions/
}
func bare4(a string, b int) string {
return a
}
func bare5(a string, b int) {
return
}