MCPcopy Create free account
hub / github.com/github/gh-aw / validateIntRange

Function validateIntRange

pkg/workflow/validation_helpers.go:71–77  ·  view source on GitHub ↗

validateIntRange validates that a value is within the specified inclusive range [min, max]. It returns an error if the value is outside the range, with a descriptive message including the field name and the actual value. Parameters: - value: The integer value to validate - min: The minimum allowed

(value, min, max int, fieldName string)

Source from the content-addressed store, hash-verified

69// return err
70// }
71func validateIntRange(value, min, max int, fieldName string) error {
72 if value < min || value > max {
73 return fmt.Errorf("%s must be between %d and %d, got %d",
74 fieldName, min, max, value)
75 }
76 return nil
77}
78
79// validateMountStringFormat parses a mount string and validates its basic format.
80// Expected format: "source:destination:mode" where mode is "ro" or "rw".

Calls 1

ErrorfMethod · 0.45

Tested by 2

TestValidateIntRangeFunction · 0.68