mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-21 21:32:13 +01:00
16 lines
211 B
Go
16 lines
211 B
Go
|
package panic
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
var shouldPanic = len(os.Getenv("NO_PANIC")) == 0
|
||
|
|
||
|
// Wraps log.Panic, ignored if NO_PANIC is set
|
||
|
func Panic(message string) {
|
||
|
if shouldPanic {
|
||
|
log.Panic(message)
|
||
|
}
|
||
|
}
|