mirror of
https://github.com/mgechev/revive.git
synced 2024-12-02 09:02:23 +02:00
68deb55492
* Adds rule superfluous-else (an extension of indent-error-flow) * Fix superfluous-else rule struct namming. * Adds superfuous-else rule to the rules table * Adds confusing-naming rule * adds multifile test * clean-up * fix config.go * deep-exit: first working version * fix pbs from @mgechev review * deep-exit: modifies failure message
33 lines
565 B
Go
33 lines
565 B
Go
package fixtures
|
|
|
|
import (
|
|
"syscall"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func foo0() {
|
|
os.Exit(1) // MATCH /calls to os.Exit only in main() or init() functions/
|
|
}
|
|
|
|
func init() {
|
|
log.Fatal("v ...interface{}")
|
|
}
|
|
|
|
func foo() {
|
|
log.Fatalf(1) // MATCH /calls to log.Fatalf only in main() or init() functions/
|
|
}
|
|
|
|
func main() {
|
|
log.Fatalln("v ...interface{}")
|
|
}
|
|
|
|
func bar() {
|
|
log.Fatal(1) // MATCH /calls to log.Fatal only in main() or init() functions/
|
|
}
|
|
|
|
func bar2() {
|
|
bar()
|
|
syscall.Exit(1) // MATCH /calls to syscall.Exit only in main() or init() functions/
|
|
}
|