1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-29 22:28:23 +02:00

renames fixtures as testdata to avoid spurious dependencies (#359)

This commit is contained in:
SalvadorC
2020-03-02 20:12:43 +01:00
committed by GitHub
parent 4af5ef3e1c
commit c469747758
80 changed files with 2 additions and 2 deletions

68
testdata/bare-return.go vendored Normal file
View File

@@ -0,0 +1,68 @@
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
}
// NR tests for issue #280
func f280_1() (err error) {
func() {
return
}()
return nil
}
func f280_2() (err error) {
func() (r int) {
return // MATCH /avoid using bare returns, please add return expressions/
}()
return nil
}
func f280_3() (err error) {
func() (r int) {
return 1
}()
return // MATCH /avoid using bare returns, please add return expressions/
}
func f280_4() (err error) {
func() (r int) {
return func() (r int) {
return // MATCH /avoid using bare returns, please add return expressions/
}()
}()
return nil
}