Skip to content

Commit

Permalink
Release v4.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
j3ssie committed Nov 17, 2022
1 parent d2f76f9 commit 1495966
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ func (r *Runner) Validator() error {
}

r.RequiredInput = strings.ToLower(strings.TrimSpace(r.RequiredInput))
//if r.RequiredInput == "file" {
// if utils.FileExists(r.Input) {
// return nil
// }
//}

var inputAsFile bool
// cidr, cidr-file
if strings.HasSuffix(r.RequiredInput, "-file") || r.RequiredInput == "file" {
Expand Down Expand Up @@ -54,13 +48,13 @@ func (r *Runner) Validator() error {

}

utils.InforF("Start validating input: %v", color.HiCyanString("%v -- %v", r.Input, r.InputType))
var err error
r.InputType, err = validate(v, r.Input)
if err != nil {
utils.ErrorF("unrecognized input: %v", r.Input)
return err
}
utils.InforF("Start validating input: %v", color.HiCyanString("%v -- %v", r.Input, r.InputType))

if !strings.HasPrefix(r.RequiredInput, r.InputType) {
return fmt.Errorf("input does not match the require validation: inputType:%v -- requireType:%v", r.InputType, r.RequiredInput)
Expand Down

0 comments on commit 1495966

Please sign in to comment.