OnlyX is like Only, but panics if an error occurs.
(ctx context.Context)
| 122 | |
| 123 | // OnlyX is like Only, but panics if an error occurs. |
| 124 | func (sq *SettingQuery) OnlyX(ctx context.Context) *Setting { |
| 125 | node, err := sq.Only(ctx) |
| 126 | if err != nil { |
| 127 | panic(err) |
| 128 | } |
| 129 | return node |
| 130 | } |
| 131 | |
| 132 | // OnlyID is like Only, but returns the only Setting ID in the query. |
| 133 | // Returns a *NotSingularError when more than one Setting ID is found. |