OnlyX is like Only, but panics if an error occurs.
(ctx context.Context)
| 147 | |
| 148 | // OnlyX is like Only, but panics if an error occurs. |
| 149 | func (_q *MetaQuery) OnlyX(ctx context.Context) *Meta { |
| 150 | node, err := _q.Only(ctx) |
| 151 | if err != nil { |
| 152 | panic(err) |
| 153 | } |
| 154 | return node |
| 155 | } |
| 156 | |
| 157 | // OnlyID is like Only, but returns the only Meta ID in the query. |
| 158 | // Returns a *NotSingularError when more than one Meta ID is found. |