(args []string)
| 321 | |
| 322 | func (maxLenConstraintType) Name() string { return ConstraintMaxLen } |
| 323 | func (maxLenConstraintType) Analyze(args []string) ([]any, error) { |
| 324 | args = parseConstraintArgs(args) |
| 325 | if len(args) == 0 { |
| 326 | return nil, errors.New("maxLen constraint requires an argument") |
| 327 | } |
| 328 | n, err := strconv.Atoi(args[0]) |
| 329 | if err != nil { |
| 330 | return nil, fmt.Errorf("parse constraint arg: %w", err) |
| 331 | } |
| 332 | return []any{n}, nil |
| 333 | } |
| 334 | |
| 335 | func (maxLenConstraintType) Execute(param string, data []any) bool { |
| 336 | if len(data) == 0 { |
nothing calls this directly
no test coverage detected