Files
llgo/internal/runtime/error.go

16 lines
249 B
Go
Raw Normal View History

2024-05-16 15:09:00 +08:00
package runtime
type errorString string
func (e errorString) RuntimeError() {}
func (e errorString) Error() string {
return "runtime error: " + string(e)
}
func CheckRuntimeError(b bool, s string) {
if b {
panic(errorString(s).Error())
}
}