mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
feature: add redundant-test-main-exit rule (#1208)
This commit is contained in:
committed by
GitHub
parent
8c5d8fc90a
commit
5f01efa722
27
testdata/redundant_test_main_exit_test.go
vendored
Normal file
27
testdata/redundant_test_main_exit_test.go
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package fixtures
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
setup()
|
||||
i := m.Run()
|
||||
teardown()
|
||||
// must not match because the go version of this module is less than 1.15
|
||||
os.Exit(i)
|
||||
}
|
||||
|
||||
func setup() {
|
||||
fmt.Println("Setup")
|
||||
}
|
||||
|
||||
func teardown() {
|
||||
fmt.Println("Teardown")
|
||||
}
|
||||
|
||||
func Test_function(t *testing.T) {
|
||||
t.Error("Fail")
|
||||
}
|
||||
Reference in New Issue
Block a user