mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-19 20:57:53 +02:00
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.
16 lines
169 B
Go
16 lines
169 B
Go
package exec
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
if v := os.Getenv(MockEnvVar); v != "" {
|
|
os.Exit(ExecuteMockData(v))
|
|
return
|
|
}
|
|
|
|
m.Run()
|
|
}
|