An IntConstraint specifies constraints on an integer.
| 485 | |
| 486 | // An IntConstraint specifies constraints on an integer. |
| 487 | type IntConstraint struct { |
| 488 | // Min and Max are both optional and inclusive bounds. |
| 489 | // Zero means don't check. |
| 490 | Min int64 `json:"min,omitempty"` |
| 491 | Max int64 `json:"max,omitempty"` |
| 492 | ZeroMin bool `json:"zeroMin,omitempty"` // if true, min is actually zero |
| 493 | ZeroMax bool `json:"zeroMax,omitempty"` // if true, max is actually zero |
| 494 | } |
| 495 | |
| 496 | func (c *IntConstraint) hasMin() bool { return c.Min != 0 || c.ZeroMin } |
| 497 | func (c *IntConstraint) hasMax() bool { return c.Max != 0 || c.ZeroMax } |
nothing calls this directly
no outgoing calls
no test coverage detected