From cec7ee4a823bdb8c8c295927642fe838a5abfc27 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Wed, 1 Mar 2023 00:33:08 +0000 Subject: [PATCH] check for email fqdn --- cmd/welcome/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/welcome/main.go b/cmd/welcome/main.go index 88695ad..d118c5e 100644 --- a/cmd/welcome/main.go +++ b/cmd/welcome/main.go @@ -93,7 +93,11 @@ func promptEmail(defaultEmail string) (email string, err error) { email := val.(string) _, err := mail.ParseAddress(email) if err != nil { - return fmt.Errorf("could not understand that email: %w", err) + return fmt.Errorf("'%s' doesn't look like an email: %w", email, err) + } + + if !strings.Contains(email, ".") { + return fmt.Errorf("'%s' doesn't look like an email: domain not fully qualified", email) } return nil