mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-21 15:58:30 +00: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)
|
||
|
|
}
|
||
|
|
}
|