MCPcopy
hub / github.com/gofiber/fiber / Analyze

Method Analyze

constraint.go:297–307  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

295
296func (minLenConstraintType) Name() string { return ConstraintMinLen }
297func (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
309func (minLenConstraintType) Execute(param string, data []any) bool {
310 if len(data) == 0 {

Callers

nothing calls this directly

Calls 3

parseConstraintArgsFunction · 0.85
NewMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected