(condition bool, args ...interface{})
| 16 | ) |
| 17 | |
| 18 | func assert(condition bool, args ...interface{}) { |
| 19 | if !condition { |
| 20 | if msg := fmt.Sprint(args...); msg != "" { |
| 21 | panic(fmt.Sprintf("assert failed, %s", msg)) |
| 22 | } else { |
| 23 | panic("assert failed") |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func unreachable() { |
| 29 | panic("unreachable") |