Do not use os.Exit in exportable packages (#286)

Fixes #285

Signed-off-by: David Cassany <dcassany@suse.com>
This commit is contained in:
David Cassany Viladomat
2022-01-12 08:57:41 +01:00
committed by GitHub
parent 4943ed6aef
commit 881bf03c3d
6 changed files with 9 additions and 10 deletions

View File

@@ -135,7 +135,7 @@ func (c *Context) Copy() types.Context {
func (c *Context) Warning(mess ...interface{}) {
c.Logger.Warn(mess...)
if c.Config.General.FatalWarns {
os.Exit(2)
panic("panic on warning")
}
}
@@ -146,7 +146,7 @@ func (c *Context) Warn(mess ...interface{}) {
func (c *Context) Warnf(t string, mess ...interface{}) {
c.Logger.Warnf(t, mess...)
if c.Config.General.FatalWarns {
os.Exit(2)
panic("panic on warning")
}
}