FirstIDX is like FirstID, but panics if an error occurs.
(ctx context.Context)
| 192 | |
| 193 | // FirstIDX is like FirstID, but panics if an error occurs. |
| 194 | func (spq *StoragePolicyQuery) FirstIDX(ctx context.Context) int { |
| 195 | id, err := spq.FirstID(ctx) |
| 196 | if err != nil && !IsNotFound(err) { |
| 197 | panic(err) |
| 198 | } |
| 199 | return id |
| 200 | } |
| 201 | |
| 202 | // Only returns a single StoragePolicy entity found by the query, ensuring it only returns one. |
| 203 | // Returns a *NotSingularError when more than one StoragePolicy entity is found. |
nothing calls this directly
no test coverage detected