-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
package fixtures | ||
|
||
import ( | ||
"syscall" | ||
"log" | ||
"os" | ||
"syscall" | ||
"testing" | ||
) | ||
|
||
func foo0() { | ||
os.Exit(1) // MATCH /calls to os.Exit only in main() or init() functions/ | ||
os.Exit(1) // MATCH /calls to os.Exit only in main() or init() functions/ | ||
} | ||
|
||
func init() { | ||
log.Fatal("v ...interface{}") | ||
log.Fatal("v ...interface{}") | ||
} | ||
|
||
func foo() { | ||
log.Fatalf(1) // MATCH /calls to log.Fatalf only in main() or init() functions/ | ||
log.Fatalf(1) // MATCH /calls to log.Fatalf only in main() or init() functions/ | ||
} | ||
|
||
func main() { | ||
log.Fatalln("v ...interface{}") | ||
log.Fatalln("v ...interface{}") | ||
} | ||
|
||
func bar() { | ||
log.Fatal(1) // MATCH /calls to log.Fatal only in main() or init() functions/ | ||
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/ | ||
bar() | ||
syscall.Exit(1) // MATCH /calls to syscall.Exit only in main() or init() functions/ | ||
} | ||
|
||
func TestMain(m *testing.M) { | ||
// must match because this is not a test file | ||
os.Exit(m.Run()) // MATCH /calls to os.Exit only in main() or init() functions/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package fixtures | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
// call flag.Parse() here if TestMain uses flags | ||
os.Exit(m.Run()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters