OnlyX is like Only, but panics if an error occurs.
(ctx context.Context)
| 221 | |
| 222 | // OnlyX is like Only, but panics if an error occurs. |
| 223 | func (_q *AlertQuery) OnlyX(ctx context.Context) *Alert { |
| 224 | node, err := _q.Only(ctx) |
| 225 | if err != nil { |
| 226 | panic(err) |
| 227 | } |
| 228 | return node |
| 229 | } |
| 230 | |
| 231 | // OnlyID is like Only, but returns the only Alert ID in the query. |
| 232 | // Returns a *NotSingularError when more than one Alert ID is found. |