INNER CODE UNIT · Go
mockExit
arttor/helmify · cmd/helmify/flags_test.go:18
func mockExit(code int) {
actualExitCode = code
panic("os.Exit called") // Panicking is necessary to stop execution.
}
func resetFlags(t *testing.T) {
t.Helper()
flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ContinueOnError)
}
func TestReadFlags_MutuallyExclusive(t *testing.T) {
oldArgs := os.Args
oldCommandLine := flag.CommandLine
t.Cleanup(func() {
os.Args = oldArgs
flag.CommandLine = oldCommandLine
})