8000 Error is not returned if validation fails · Issue #8 · cqroot/prompt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error is not returned if validation fails #8
Closed
@miniscruff

Description

@miniscruff

When running a prompt with an input validation, if you submit a value that fails validation, no error is returned back to let the upper program know.

Eg in this example: https://github.com/cqroot/prompt/blob/main/examples/input-with-validation/main.go, if you were to submit an invalid ip it just works. I believe the correct scenario would be that .Ask(...).Input(...) would return "", <error returned from validation>.

what happens in the validation example

prompt/examples/input-with-validation  main ✔
▶ go run main.go
✔ Please enter the server IP: … invalid ip address
invalid ip address   # this should be the "is not a valid ip" error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0