From efccae0782c79e578cbe8dc102f02b38833b2744 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 4 Aug 2022 17:13:30 -0500 Subject: [PATCH] make error more clear --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 8e109f8..d897b81 100644 --- a/main.go +++ b/main.go @@ -65,10 +65,13 @@ func main() { func run(c *cli.Context) error { user := c.String("username") - pass := c.String("password") + if user == "" { + return errors.New("username required") + } - if user == "" || pass == "" { - return errors.New("username and password required") + pass := c.String("password") + if pass == "" { + return errors.New("password required") } reg, err := name.NewRegistry(c.String("registry"))