1
0
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:
Semih Buyukgungor
2025-01-29 16:36:00 +03:00
committed by GitHub
parent 8c5d8fc90a
commit 5f01efa722
11 changed files with 202 additions and 2 deletions

View 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")
}