dsfx/internal/lib/assert/assert.go

11 lines
212 B
Go
Raw Normal View History

2025-03-08 15:07:27 -05:00
package assert
2025-03-09 16:26:25 -04:00
import "fmt"
2025-03-08 15:07:27 -05:00
// Assert panics if the given truth value is false, with the given message.
func Assert(truth bool, msg string) {
if !truth {
2025-03-09 16:26:25 -04:00
panic(fmt.Sprintf("Assertion Failed: %s", msg))
2025-03-08 15:07:27 -05:00
}
}