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

Method Analyze

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

Source from the content-addressed store, hash-verified

321
322func (maxLenConstraintType) Name() string { return ConstraintMaxLen }
323func (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
335func (maxLenConstraintType) Execute(param string, data []any) bool {
336 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