OnlyX is like Only, but panics if an error occurs.
(ctx context.Context)
| 171 | |
| 172 | // OnlyX is like Only, but panics if an error occurs. |
| 173 | func (sq *ShareQuery) OnlyX(ctx context.Context) *Share { |
| 174 | node, err := sq.Only(ctx) |
| 175 | if err != nil { |
| 176 | panic(err) |
| 177 | } |
| 178 | return node |
| 179 | } |
| 180 | |
| 181 | // OnlyID is like Only, but returns the only Share ID in the query. |
| 182 | // Returns a *NotSingularError when more than one Share ID is found. |