(args []string)
| 295 | |
| 296 | func (minLenConstraintType) Name() string { return ConstraintMinLen } |
| 297 | func (minLenConstraintType) Analyze(args []string) ([]any, error) { |
| 298 | args = parseConstraintArgs(args) |
| 299 | if len(args) == 0 { |
| 300 | return nil, errors.New("minLen constraint requires an argument") |
| 301 | } |
| 302 | n, err := strconv.Atoi(args[0]) |
| 303 | if err != nil { |
| 304 | return nil, fmt.Errorf("parse constraint arg: %w", err) |
| 305 | } |
| 306 | return []any{n}, nil |
| 307 | } |
| 308 | |
| 309 | func (minLenConstraintType) Execute(param string, data []any) bool { |
| 310 | if len(data) == 0 { |
nothing calls this directly
no test coverage detected