Projects STRLCPY Osmedeus Commits 1495966b
🤬
  • ■ ■ ■ ■ ■
    core/validate.go
    skipped 15 lines
    16 16   }
    17 17   
    18 18   r.RequiredInput = strings.ToLower(strings.TrimSpace(r.RequiredInput))
    19  - //if r.RequiredInput == "file" {
    20  - // if utils.FileExists(r.Input) {
    21  - // return nil
    22  - // }
    23  - //}
    24  - 
    25 19   var inputAsFile bool
    26 20   // cidr, cidr-file
    27 21   if strings.HasSuffix(r.RequiredInput, "-file") || r.RequiredInput == "file" {
    skipped 26 lines
    54 48   
    55 49   }
    56 50   
    57  - utils.InforF("Start validating input: %v", color.HiCyanString("%v -- %v", r.Input, r.InputType))
    58 51   var err error
    59 52   r.InputType, err = validate(v, r.Input)
    60 53   if err != nil {
    61 54   utils.ErrorF("unrecognized input: %v", r.Input)
    62 55   return err
    63 56   }
     57 + utils.InforF("Start validating input: %v", color.HiCyanString("%v -- %v", r.Input, r.InputType))
    64 58   
    65 59   if !strings.HasPrefix(r.RequiredInput, r.InputType) {
    66 60   return fmt.Errorf("input does not match the require validation: inputType:%v -- requireType:%v", r.InputType, r.RequiredInput)
    skipped 75 lines
Please wait...
Page is in error, reload to recover