You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-07-03 00:57:43 +02:00
test: remove redundant os.Exit in TestMain (#5257)
This PR simplifies tests by removing redundant `os.Exit` calls in `TestMain` functions. As of Go 1.15, we do not need to call `os.Exit(m.Run())` explicitly, as value returned by `m.Run()` is stored into unexported field of `m` and go test executable is smart enough to automatically call `os.Exit(retValue)` when `TestMain` returns. See golang/go#34129.
This commit is contained in:
@ -30,7 +30,8 @@ var listen string
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
if !testlib.InPath("docker") {
|
||||
os.Exit(m.Run())
|
||||
m.Run()
|
||||
return
|
||||
}
|
||||
prepareEnv()
|
||||
|
||||
@ -67,10 +68,9 @@ func TestMain(m *testing.M) {
|
||||
}))
|
||||
listen = "localhost:" + resource.GetPort("9000/tcp")
|
||||
|
||||
code := m.Run()
|
||||
m.Run()
|
||||
|
||||
requireNoErr(pool.Purge(resource))
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
func TestMinioUpload(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user