mirror of
https://github.com/bloeys/nterm.git
synced 2025-12-29 06:28:20 +00:00
Detect lines as they come in+sprintf in assert so it gets optimized away on release mode :)
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
package assert
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bloeys/nterm/consts"
|
||||
)
|
||||
|
||||
func T(check bool, msg string) {
|
||||
func T(check bool, msg string, args ...any) {
|
||||
if consts.Mode_Debug && !check {
|
||||
panic("Assert failed: " + msg)
|
||||
panic("Assert failed: " + fmt.Sprintf(msg, args...))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user