We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code:
package main import ( "fmt" "github.com/alecthomas/kong" kongyaml "github.com/alecthomas/kong-yaml" "os" "strings" ) type CLI struct { UserEnumType int `required:"" enum:"1,2,3,4,5"` } func main() { data := `user-enum-type: 44423` resolver, err := kongyaml.Loader(strings.NewReader(data)) if err != nil { fmt.Printf("Err: %v\n", err) os.Exit(1) } var cli CLI parser, err := kong.New(&cli, kong.Resolvers(resolver)) if err != nil { fmt.Printf("Err: %v\n", err) os.Exit(1) } _, err = parser.Parse(nil) if err != nil { fmt.Printf("Err: %v\n", err) os.Exit(1) } fmt.Printf("UserEnumType: %d\n", cli.UserEnumType) }
returns an weird error like this:
Err: --user-enum-type must be one of "1","2","3","4","5" but got '궇'
it should be but got '44423'. this only happens to INT. strings works fine.
but got '44423'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following code:
returns an weird error like this:
it should be
but got '44423'
.this only happens to INT. strings works fine.
The text was updated successfully, but these errors were encountered: