mustQuery executes a query, and panics on failure. Used for queries that should never fail, even taking into account test setup.
(db *DB, stmt string)
| 1549 | // mustQuery executes a query, and panics on failure. Used for queries that should |
| 1550 | // never fail, even taking into account test setup. |
| 1551 | func mustQuery(db *DB, stmt string) []*command.QueryRows { |
| 1552 | r, err := db.QueryStringStmt(stmt) |
| 1553 | if err != nil { |
| 1554 | panic(fmt.Sprintf("failed to query: %s", err.Error())) |
| 1555 | } |
| 1556 | return r |
| 1557 | } |
| 1558 | |
| 1559 | func asJSON(v any) string { |
| 1560 | enc := encoding.Encoder{} |
no test coverage detected