Limit returns a derivative query that has a limit on the number of results returned. A negative value means unlimited.
(limit int)
| 228 | // Limit returns a derivative query that has a limit on the number of results |
| 229 | // returned. A negative value means unlimited. |
| 230 | func (q *Query) Limit(limit int) *Query { |
| 231 | q = q.clone() |
| 232 | if limit < math.MinInt32 || limit > math.MaxInt32 { |
| 233 | q.err = errors.New("datastore: query limit overflow") |
| 234 | return q |
| 235 | } |
| 236 | q.limit = int32(limit) |
| 237 | return q |
| 238 | } |
| 239 | |
| 240 | // Offset returns a derivative query that has an offset of how many keys to |
| 241 | // skip over before returning results. A negative value is invalid. |