1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +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

37
testdata/unreachable-code.go vendored Normal file
View File

@@ -0,0 +1,37 @@
package fixtures
import (
"fmt"
"log"
"os"
)
func foo() int {
log.Fatalf("%s", "About to fail") // ignore
return 0 // MATCH /unreachable code after this statement/
return 1
Println("unreachable")
}
func f() {
fmt.Println("Hello, playground")
if true {
return // MATCH /unreachable code after this statement/
Println("unreachable")
os.Exit(2) // ignore
Println("also unreachable")
}
return // MATCH /unreachable code after this statement/
fmt.Println("Bye, playground")
}
func g() {
fmt.Println("Hello, playground")
if true {
return // ignore if next stmt is labeled
label:
os.Exit(2) // ignore
}
fmt.Println("Bye, playground")
}