(provided int, allowed int, allowedVals ...int)
| 248 | } |
| 249 | |
| 250 | func ErrorInvalidInt(provided int, allowed int, allowedVals ...int) error { |
| 251 | allAllowedVals := append([]int{allowed}, allowedVals...) |
| 252 | return errors.WithStack(&errors.Error{ |
| 253 | Kind: ErrInvalidInt, |
| 254 | Message: fmt.Sprintf("invalid value (got %s, must be %s)", s.UserStr(provided), s.UserStrsOr(allAllowedVals)), |
| 255 | }) |
| 256 | } |
| 257 | |
| 258 | func ErrorInvalidStr(provided string, allowed string, allowedVals ...string) error { |
| 259 | allAllowedVals := append([]string{allowed}, allowedVals...) |
no test coverage detected