From 74e325833de977e3d81db3fa692c0881721bd0db Mon Sep 17 00:00:00 2001 From: Alec Aivazis Date: Tue, 18 Apr 2017 09:38:05 -0700 Subject: [PATCH] Update README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4efc3d70..ccf816ff 100644 --- a/README.md +++ b/README.md @@ -138,11 +138,9 @@ response: q := &survey.Question{ Prompt: &survey.Input{Message: "Hello world validation"}, Validate: func (val interface{}) error { - // since we are validating an Input, this will always succeed - if str, ok := val.(string) ; ok { - if len(str) > 10 { - return errors.New("This response cannot be longer than 10 characters.") - } + // since we are validating an Input, the assertion will always succeed + if str, ok := val.(string) ; ok && len(str) > 10 { + return errors.New("This response cannot be longer than 10 characters.") } } }